forked from stride3d/stride
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SettingsWindow.xaml
99 lines (95 loc) · 6.31 KB
/
SettingsWindow.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<sd:ModalWindow x:Class="Stride.Core.Assets.Editor.View.SettingsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sd="http://schemas.stride3d.net/xaml/presentation"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:behaviors="clr-namespace:Stride.Core.Assets.Editor.View.Behaviors"
xmlns:valueConverters="clr-namespace:Stride.Core.Assets.Editor.View.ValueConverters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:edvw="clr-namespace:Stride.Core.Assets.Editor.View"
xmlns:viewModels="clr-namespace:Stride.Core.Assets.Editor.Settings.ViewModels"
xmlns:viewModels1="clr-namespace:Stride.Core.Presentation.Quantum.ViewModels;assembly=Stride.Core.Presentation.Quantum"
mc:Ignorable="d" d:DataContext="{d:DesignInstance viewModels:SettingsViewModel}"
ShowInTaskbar="False"
Title="{sd:Localize Settings}" Height="768" Width="1024" Style="{DynamicResource WindowChromeStyle}"
>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="CommonResources.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<DockPanel>
<UniformGrid Rows="1" DockPanel.Dock="Bottom" Margin="20" HorizontalAlignment="Right">
<Button Margin="10,0,0,0" Padding="20,4" Content="{sd:Localize Save and close, Context=Button}">
<i:Interaction.Behaviors>
<sd:ButtonCloseWindowBehavior Command="{Binding ValidateChangesCommand}"/>
</i:Interaction.Behaviors>
</Button>
<Button Margin="10,0,0,0" Padding="20,4" Content="{sd:Localize Cancel, Context=Button}" IsCancel="True">
<i:Interaction.Behaviors>
<sd:ButtonCloseWindowBehavior Command="{Binding DiscardChangesCommand}"/>
</i:Interaction.Behaviors>
</Button>
</UniformGrid>
<Grid Margin="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>
<sd:TreeView Grid.Column="0" ItemsSource="{Binding Categories}" SelectedItem="{Binding SelectedCategory, Mode=TwoWay}" SelectionMode="Single">
<sd:TreeView.ItemContainerStyle>
<Style TargetType="{x:Type sd:TreeViewItem}" BasedOn="{StaticResource {x:Type sd:TreeViewItem}}">
<Setter Property="IsExpanded" Value="{Binding Mode=OneTime, Converter={valueConverters:SettingsCategoryToExpandedAtInitialization}}"/>
</Style>
</sd:TreeView.ItemContainerStyle>
<sd:TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding SubCategories}">
<TextBlock Text="{Binding Name}"/>
</HierarchicalDataTemplate>
</sd:TreeView.ItemTemplate>
</sd:TreeView>
<GridSplitter Grid.Column="1" Width="5" ResizeBehavior="PreviousAndNext" VerticalAlignment="Stretch" />
<sd:PropertyView NameColumnSize="310" Grid.Column="2" ItemsSource="{Binding ViewModel.RootNode.Children}" BorderThickness="1" Background="{DynamicResource BackgroundBrush}" Padding="5">
<sd:PropertyView.ItemContainerStyle>
<Style BasedOn="{StaticResource {x:Type sd:PropertyViewItem}}" TargetType="sd:PropertyViewItem">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HeaderTemplate">
<Setter.Value>
<HierarchicalDataTemplate ItemsSource="{Binding Children, Mode=OneWay}" DataType="viewModels1:NodeViewModel">
<ContentPresenter Content="{Binding}" ContentTemplateSelector="{x:Static edvw:PropertyViewHelper.HeaderProviders}"/>
</HierarchicalDataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="sd:PropertyViewItem">
<Border BorderThickness="{TemplateBinding Border.BorderThickness}" BorderBrush="{TemplateBinding Border.BorderBrush}" SnapsToDevicePixels="True"
Visibility="{Binding IsVisible, Converter={sd:VisibleOrCollapsed}}" d:DataContext="{d:DesignInstance viewModels1:NodeViewModel}">
<DockPanel>
<Border DockPanel.Dock="Top" Background="{TemplateBinding Background}">
<ContentPresenter Content="{TemplateBinding HeaderedContentControl.Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" ContentStringFormat="{TemplateBinding HeaderedItemsControl.HeaderStringFormat}" ContentSource="Header" Name="PART_Header" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border>
<Border DockPanel.Dock="Bottom" Background="{TemplateBinding Background}">
<ContentPresenter Content="{TemplateBinding HeaderedContentControl.Header}" ContentTemplateSelector="{x:Static edvw:PropertyViewHelper.FooterProviders}" Name="PART_Footer" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border>
<Expander x:Name="propertyExpander" IsExpanded="{TemplateBinding IsExpanded}" Style="{StaticResource PropertyExpanderStyle}" IsEnabled="True">
<ItemsPresenter Name="ItemsHost"/>
</Expander>
</DockPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</sd:PropertyView.ItemContainerStyle>
<i:Interaction.Behaviors>
<behaviors:PropertyViewAutoExpandNodesBehavior ViewModel="{Binding ViewModel, Mode=OneWay}"/>
</i:Interaction.Behaviors>
</sd:PropertyView>
</Grid>
</DockPanel>
</sd:ModalWindow>