Wire up the views.
This commit is contained in:
@ -26,28 +26,25 @@
|
||||
Title="Neues Element auswählen"
|
||||
>
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/zaaReloaded2;component/Style.xaml" />
|
||||
<ResourceDictionary>
|
||||
<DataTemplate x:Key="ChildElement">
|
||||
<TextBlock Text="{Binding DisplayString}" />
|
||||
</DataTemplate>
|
||||
<HierarchicalDataTemplate x:Key="CategoriesTree"
|
||||
ItemsSource="{Binding Children}"
|
||||
ItemTemplate="{StaticResource ResourceKey=ChildElement}">
|
||||
<TextBlock Text="{Binding DisplayString}" />
|
||||
</HierarchicalDataTemplate>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary Source="/zaaReloaded2;component/Style.xaml" />
|
||||
</Window.Resources>
|
||||
<StackPanel Margin="10">
|
||||
<Label Content="Verfügbare Elemente:" Target="{Binding ElementName=ElementsTreeView}" />
|
||||
<!-- TODO: Expand tree by default. -->
|
||||
<TreeView ItemsSource="{Binding Categories}" ItemTemplate="{StaticResource ResourceKey=CategoriesTree}"
|
||||
Height="160" Width="240"/>
|
||||
<UniformGrid HorizontalAlignment="Right" Columns="2" Rows="1" Margin="0 10 0 0">
|
||||
<TreeView ItemsSource="{Binding Categories}" Height="120">
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
|
||||
<TextBlock Text="{Binding DisplayString}" />
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
<UniformGrid Columns="2" Rows="1" Margin="0 10 0 0">
|
||||
<Button Content="OK" Command="{Binding ChooseElementCommand}" IsDefault="True" Margin="0 0 10 0" />
|
||||
<Button Content="Abbrechen" Command="{Binding CloseViewCommand}" IsCancel="True" Margin="10 0 0 0" />
|
||||
</UniformGrid>
|
||||
|
@ -28,9 +28,10 @@
|
||||
<Window.Resources>
|
||||
<ResourceDictionary Source="/zaaReloaded2;component/Style.xaml" />
|
||||
</Window.Resources>
|
||||
<StackPanel Margin="20">
|
||||
<StackPanel Margin="10">
|
||||
<Label Content="Inhalt:" Target="{Binding ElementName=ContentTextBox}" />
|
||||
<TextBox Text="{Binding Content}" x:Name="ContentTextBox" Margin="0 0 0 5"
|
||||
<TextBox Text="{Binding Content,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
x:Name="ContentTextBox" Margin="0 0 0 5"
|
||||
Width="300" Height="60" TextWrapping="Wrap" />
|
||||
<UniformGrid HorizontalAlignment="Right" Columns="2" Rows="1" Margin="0 10 0 0">
|
||||
<Button Content="OK" Command="{Binding SaveCommand}" IsDefault="True" Margin="0 0 5 0" />
|
||||
|
@ -23,7 +23,7 @@
|
||||
xmlns:b="clr-namespace:Bovender.Mvvm.Views.Settings;assembly=Bovender"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:action="clr-namespace:Bovender.Mvvm.Actions;assembly=Bovender"
|
||||
SizeToContent="WidthAndHeight" ResizeMode="CanResizeWithGrip" ShowInTaskbar="False"
|
||||
Width="380" Height="340" ResizeMode="CanResizeWithGrip" ShowInTaskbar="False"
|
||||
b:WindowState.CenterScreen="True" b:WindowState.Save="True"
|
||||
Title="Stil auswählen"
|
||||
>
|
||||
|
@ -23,26 +23,12 @@
|
||||
xmlns:b="clr-namespace:Bovender.Mvvm.Views.Settings;assembly=Bovender"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:action="clr-namespace:Bovender.Mvvm.Actions;assembly=Bovender"
|
||||
SizeToContent="WidthAndHeight" ResizeMode="CanResizeWithGrip" ShowInTaskbar="False"
|
||||
Width="640" Height="480" ResizeMode="CanResizeWithGrip" ShowInTaskbar="False"
|
||||
b:WindowState.CenterScreen="True" b:WindowState.Save="True"
|
||||
Title="Stil bearbeiten"
|
||||
>
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/zaaReloaded2;component/Style.xaml" />
|
||||
<ResourceDictionary>
|
||||
<DataTemplate x:Key="ChildElement">
|
||||
<TextBlock Text="{Binding DisplayString}" />
|
||||
</DataTemplate>
|
||||
<HierarchicalDataTemplate x:Key="ElementsTree"
|
||||
ItemsSource="{Binding Elements}"
|
||||
ItemTemplate="{StaticResource ResourceKey=ChildElement}">
|
||||
<TextBlock Text="{Binding DisplayString}" />
|
||||
</HierarchicalDataTemplate>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary Source="/zaaReloaded2;component/Style.xaml" />
|
||||
</Window.Resources>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger SourceObject="{Binding AddElementMessage}" EventName="Sent">
|
||||
@ -54,14 +40,17 @@
|
||||
<i:EventTrigger SourceObject="{Binding EditElementMessage}" EventName="Sent">
|
||||
<action:ShowViewDialogAction View="zaaReloaded2.Views.ElementView" Assembly="zaaReloaded2" />
|
||||
</i:EventTrigger>
|
||||
<i:EventTrigger SourceObject="{Binding ChangeControlElementMessage}" EventName="Sent">
|
||||
<action:ShowViewDialogAction View="zaaReloaded2.Views.ElementPickerView" Assembly="zaaReloaded2" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<StackPanel Margin="10">
|
||||
<DockPanel IsEnabled="{Binding IsNameEnabled}">
|
||||
<DockPanel Margin="10">
|
||||
<DockPanel DockPanel.Dock="Top" IsEnabled="{Binding IsNameEnabled}">
|
||||
<Label DockPanel.Dock="Left" Content="Name:" Target="{Binding ElementName=NameTextBox}"
|
||||
Margin="0 0 10 0"/>
|
||||
<TextBox Text="{Binding Name}" x:Name="NameTextBox" HorizontalAlignment="Stretch" />
|
||||
</DockPanel>
|
||||
<DockPanel>
|
||||
<DockPanel DockPanel.Dock="Top">
|
||||
<Label DockPanel.Dock="Left" Content="Referenzwerte anzeigen:" Margin="0 0 10 0"
|
||||
Target="{Binding ElementName=ReferenceStyleChooser}" />
|
||||
<ComboBox ItemsSource="{Binding ReferenceStyle.Choices}"
|
||||
@ -69,6 +58,10 @@
|
||||
SelectedItem="{Binding ReferenceStyle.SelectedItem}"
|
||||
x:Name="ReferenceStyleChooser" HorizontalAlignment="Stretch" />
|
||||
</DockPanel>
|
||||
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Command="{Binding CloseViewCommand}" Content="Schließen" IsDefault="True" IsCancel="True" Margin="0 10 0 0"
|
||||
Width="{Binding ElementName=NewElementButton,Path=ActualWidth}"/>
|
||||
</StackPanel>
|
||||
<GroupBox Header="Elemente" Margin="0 10 0 0">
|
||||
<DockPanel LastChildFill="True">
|
||||
<StackPanel DockPanel.Dock="Right" Margin="10 0 0 0">
|
||||
@ -77,16 +70,22 @@
|
||||
<Button Command="{Binding AddChildElementCommand}" Content="Neues Kindelement" Margin="0 0 0 10" />
|
||||
<Button Command="{Binding EditElementCommand}" IsDefault="True" Content="Bearbeiten" Margin="0 0 0 10" />
|
||||
<Button Command="{Binding CopyElementCommand}" Content="Kopieren" Margin="0 0 0 10" />
|
||||
<Button Command="{Binding RemoveElementCommand}" Content="Entfernen" Margin="0 0 0 10" />
|
||||
<Button Command="{Binding DeleteElementCommand}" Content="Entfernen" Margin="0 0 0 10" />
|
||||
</StackPanel>
|
||||
<TreeView ItemsSource="{Binding Elements}"
|
||||
ItemTemplate="{StaticResource ResourceKey=ElementsTree}"
|
||||
MinWidth="200"/>
|
||||
<TreeView ItemsSource="{Binding Elements}">
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsExpanded" Value="True" />
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
<TreeView.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding Elements}">
|
||||
<TextBlock Text="{Binding DisplayString}" />
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
</DockPanel>
|
||||
</GroupBox>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Command="{Binding CloseViewCommand}" Content="Schließen" IsCancel="True" Margin="0 10 0 0"
|
||||
Width="{Binding ElementName=NewElementButton,Path=ActualWidth}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</Window>
|
||||
|
Reference in New Issue
Block a user