forked from Skilllab/IntermechToSouz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
59 lines (57 loc) · 2.66 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<Window
x:Class="IntermechToSouz.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:local="clr-namespace:IntermechToSouz"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:models1="clr-namespace:Streamdivision.Framework;assembly=Streamdivision.Framework"
Title="MainWindow"
Width="600"
MaxHeight="600"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="100" />
</Grid.RowDefinitions>
<TreeView
Name="MainMaterialTreeView"
ItemsSource="{Binding PlmTree, UpdateSourceTrigger=PropertyChanged}"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate DataType="{x:Type models1:BaseTreeModel}" ItemsSource="{Binding Children}">
<TextBlock Text="{Binding DisplayText}" />
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
<TreeView.ItemContainerStyle>
<Style TargetType="TreeViewItem">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</Style>
</TreeView.ItemContainerStyle>
<!--<i:Interaction.Behaviors>
<behaviors:BindableSelectedItemBehavior2
SelectedItem="{Binding SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</i:Interaction.Behaviors>-->
</TreeView>
<StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<Button
Padding="5"
Height="30"
Margin="2" Content="Создать дерево"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{Binding Build}" />
<Button
Padding="5"
Height="30"
Margin="2" Content="Сохранить дерево в XML"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Command="{Binding Save}" />
</StackPanel>
</Grid>
</Window>