<Window x:Class="Сикрет.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Сикрет.Data"
xmlns:Charting="clr-namespace:ControlLib;assembly=NumericUpDown"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Control.Resources>
<Style TargetType="MenuItem">
<Setter Property="FontSize" Value="12"/>
</Style>
<Style TargetType="RadioButton">
<Setter Property="FontSize" Value="11"/>
</Style>
<DataTemplate x:Key="tplItemRect" DataType="{x:Type local:Item}">
<Rectangle Width="6" Height="6" Stroke="DeepSkyBlue"/>
</DataTemplate>
<ItemsPanelTemplate x:Key="tplHorizontal">
<StackPanel Visibility="Collapsed"/>
</ItemsPanelTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:Item}" ItemsSource="{Binding Items}">
<StackPanel Orientation="Horizontal">
<Image Height="14" Margin="0 0 5 4" Source="{Binding PathToImage}"/>
<TextBlock FontSize="{Binding TreeViewTextSize}" Text="{Binding Title}" Margin="0 0 10 4"/>
<ItemsControl ItemsSource="{Binding Items}"
ItemTemplate="{StaticResource tplItemRect}"
ItemsPanel="{StaticResource tplHorizontal}"/>
</StackPanel>
</HierarchicalDataTemplate>
<ContextMenu x:Key="TreeViewContextMenu">
<MenuItem Header="добавить" Visibility="{Binding TreeViewContextMenuVisibility.Add}"/>
<MenuItem Header="удалить" Visibility="{Binding TreeViewContextMenuVisibility.Delete}"/>
<MenuItem Header="переименовать" Visibility="{Binding TreeViewContextMenuVisibility.Rename}"/>
</ContextMenu>
</Control.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="auto"/>
<RowDefinition />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90"/>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Button Content="Открыть" Command="{Binding command_LoadDB}" Grid.Column="0" Height="25" Width="70"/>
<TextBlock FontSize="11" Text="Размер шрифта:" Grid.Column="2" HorizontalAlignment="Right" Margin="0 15 50 0"/>
<Charting:NumericUpDown Value="{Binding TreeViewTextSize, Mode=TwoWay}" Grid.Column="2" Height="20" Width="32" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0 10 10 0" />
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBlock FontSize="12" Text="Фильтр:" Grid.Column="0" Margin="20 4 0 0"/>
<TextBox Grid.Column="1" Height="20" Margin="10 2 10 10" VerticalAlignment="Top"/>
<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<RadioButton IsChecked="True" Content="по названию элемента" Grid.Row="0" Margin="5 5 10 5" Height="15"/>
<RadioButton Content="по названию раздела" Grid.Row="1" Margin="5 5 10 5" Height="15"></RadioButton>
<RadioButton Content="по названию файла" Grid.Row="2" Margin="5 5 10 5" Height="15"></RadioButton>
</Grid>
</Grid>
<TreeView Grid.Row="2" Margin="10" ItemsSource="{Binding ItemsTree.Items}" ContextMenu="{StaticResource TreeViewContextMenu}"/>
</Grid>
</Window>