Use buttons in SettingsView.

This commit is contained in:
Daniel Kraus 2015-08-12 17:54:23 +02:00
parent 6f65340ca5
commit e0b749382e
7 changed files with 29 additions and 10 deletions

BIN
gimp/plus-child.xcf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

View File

@ -45,7 +45,9 @@ namespace zaaReloaded2.ViewModels
{ {
return ((ControlElementBase)Element).CanHaveChildren; return ((ControlElementBase)Element).CanHaveChildren;
} }
} }
public override string ToolTip { get { return Element.Label; } }
#endregion #endregion

View File

@ -39,6 +39,8 @@ namespace zaaReloaded2.ViewModels
get { return Element.Label; } get { return Element.Label; }
} }
public abstract string ToolTip { get; }
#endregion #endregion
#region Constructors #region Constructors

View File

@ -46,6 +46,8 @@ namespace zaaReloaded2.ViewModels
/// </summary> /// </summary>
public ControlElementViewModel Parent { get; set; } public ControlElementViewModel Parent { get; set; }
public override string ToolTip { get { return Element.Label; } }
#endregion #endregion
#region Commands #region Commands

View File

@ -60,29 +60,39 @@
x:Name="ReferenceStyleChooser" HorizontalAlignment="Stretch" /> x:Name="ReferenceStyleChooser" HorizontalAlignment="Stretch" />
</DockPanel> </DockPanel>
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right"> <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
<Button Command="{Binding CloseViewCommand}" Content="Schließen" IsDefault="True" IsCancel="True" Margin="0 10 0 0" <Button Command="{Binding CloseViewCommand}" Content="Schließen" IsDefault="True" IsCancel="True"
Width="{Binding ElementName=NewElementButton,Path=ActualWidth}"/> Margin="0 10 0 0" />
</StackPanel> </StackPanel>
<GroupBox Header="Elemente" Margin="0 10 0 0"> <GroupBox Header="Elemente" Margin="0 10 0 0">
<DockPanel LastChildFill="True"> <DockPanel LastChildFill="True">
<StackPanel DockPanel.Dock="Right" Margin="10 0 0 0"> <StackPanel DockPanel.Dock="Right" Margin="10 0 0 0">
<Button Command="{Binding AddElementCommand}" Content="Neues Element" Margin="0 0 0 10" <Button Command="{Binding AddElementCommand}" ToolTip="Neues Element" Margin="0 0 0 10">
x:Name="NewElementButton"/> <Image Source="/zaaReloaded2;component/Icons/plus.png" Width="24" />
<Button Command="{Binding AddChildElementCommand}" Content="Neues Kindelement" Margin="0 0 0 10" /> </Button>
<Button Command="{Binding EditElementCommand}" IsDefault="True" Content="Bearbeiten" Margin="0 0 0 10" /> <Button Command="{Binding AddChildElementCommand}" ToolTip="Neues Kindelement" Margin="0 0 0 10">
<Button Command="{Binding CopyElementCommand}" Content="Kopieren" Margin="0 0 0 10" /> <Image Source="/zaaReloaded2;component/Icons/plus-child.png" Width="24" />
<Button Command="{Binding DeleteElementCommand}" Content="Entfernen" Margin="0 0 0 10" /> </Button>
<Button Command="{Binding DeleteElementCommand}" ToolTip="Entfernen" Margin="0 0 0 10">
<Image Source="/zaaReloaded2;component/Icons/minus.png" Width="24" />
</Button>
<Button Command="{Binding EditElementCommand}" IsDefault="True" ToolTip="Bearbeiten" Margin="0 0 0 10">
<Image Source="/zaaReloaded2;component/Icons/pen.png" Width="24" />
</Button>
<Button Command="{Binding CopyElementCommand}" ToolTip="Kopieren" Margin="0 0 0 10">
<Image Source="/zaaReloaded2;component/Icons/duplicate.png" Width="24" />
</Button>
</StackPanel> </StackPanel>
<TreeView ItemsSource="{Binding Elements}"> <TreeView ItemsSource="{Binding Elements}">
<TreeView.ItemContainerStyle> <TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}"> <Style TargetType="{x:Type TreeViewItem}">
<!--<Setter Property="IsExpanded" Value="True" />--> <!--<Setter Property="IsExpanded" Value="True" />-->
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="ToolTip" Value="{Binding ToolTip}" />
</Style> </Style>
</TreeView.ItemContainerStyle> </TreeView.ItemContainerStyle>
<TreeView.ItemTemplate> <TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Elements}"> <HierarchicalDataTemplate ItemsSource="{Binding Elements}">
<TextBlock Text="{Binding DisplayString}" /> <TextBlock Text="{Binding DisplayString}" ToolTip="{Binding ToolTip}" />
</HierarchicalDataTemplate> </HierarchicalDataTemplate>
</TreeView.ItemTemplate> </TreeView.ItemTemplate>
</TreeView> </TreeView>

View File

@ -398,6 +398,9 @@
<ItemGroup> <ItemGroup>
<Resource Include="Icons\exit.png" /> <Resource Include="Icons\exit.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Icons\plus-child.png" />
</ItemGroup>
<PropertyGroup> <PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>