diff options
author | sr55 <[email protected]> | 2012-03-10 16:15:42 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-03-10 16:15:42 +0000 |
commit | a3f2fa978a733e2461d68be2bf2ce39bdf540a0b (patch) | |
tree | 188762f474905ccdd9a48dd1880f3f5184454b61 /win/CS/HandBrakeWPF/Views/MainView.xaml | |
parent | ae344e17e55b77c982640f3a7f9ad4156681a1c7 (diff) |
WinGui: (WPF) Preview pane grouping added.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4503 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Views/MainView.xaml')
-rw-r--r-- | win/CS/HandBrakeWPF/Views/MainView.xaml | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index e39625785..9a44920af 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -30,6 +30,34 @@ <Setter Property="Padding" Value="5,5" />
</Style>
+
+ <CollectionViewSource x:Key="presetsCvs" Source="{Binding Presets}">
+ <CollectionViewSource.GroupDescriptions>
+ <PropertyGroupDescription PropertyName="Category"/>
+ </CollectionViewSource.GroupDescriptions>
+ </CollectionViewSource>
+
+ <DataTemplate x:Key="presetsTemplate">
+ <StackPanel>
+ <TextBlock Text="{Binding Path=Name}"/>
+ </StackPanel>
+ </DataTemplate>
+
+ <HierarchicalDataTemplate x:Key="presetsCategoryTemplate" ItemsSource="{Binding Path=Items}"
+ ItemTemplate="{StaticResource presetsTemplate}">
+ <TextBlock Text="{Binding Path=Name}" FontWeight="Bold"/>
+ </HierarchicalDataTemplate>
+
+ <Style TargetType="TreeViewItem">
+ <Setter Property="IsExpanded" Value="True" />
+ <Setter Property="Padding" Value="0,2,0,2" />
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsBuildIn}" Value="True">
+ <Setter Property="Foreground" Value="DarkBlue" />
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
</Window.Resources>
@@ -160,18 +188,18 @@ <ComboBox Name="Angles" Margin="8,0,0,0" MinWidth="60" ItemsSource="{Binding Angles}" SelectedItem="{Binding SelectedAngle}"/>
<ComboBox Name="PointToPointMode" Margin="8,0,0,0" MinWidth="80" ItemsSource="{Binding RangeMode}" SelectedItem="{Binding SelectedPointToPoint}" />
-
+
<ComboBox Name="StartPoint" Margin="8,0,0,0" MinWidth="60" ItemsSource="{Binding StartEndRangeItems}" SelectedItem="{Binding SelectedStartPoint}"
Visibility="{Binding ShowTextEntryForPointToPointMode,Converter={StaticResource boolToVisConverter}, ConverterParameter=true}"/>
<TextBox Name="StartPointText" Margin="8,0,0,0" MinWidth="60" Text="{Binding SelectedStartPoint}"
Visibility="{Binding ShowTextEntryForPointToPointMode, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"/>
-
+
<Label Content="through" Margin="8,0,0,0" />
<ComboBox Name="EndPoint" Margin="8,0,0,0" MinWidth="60" ItemsSource="{Binding StartEndRangeItems}" SelectedItem="{Binding SelectedEndPoint}"
Visibility="{Binding ShowTextEntryForPointToPointMode, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}"/>
<TextBox Name="EndPointText" Margin="8,0,0,0" MinWidth="60" Text="{Binding SelectedEndPoint}"
Visibility="{Binding ShowTextEntryForPointToPointMode, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
-
+
<Label Content="Duration" Margin="8,0,0,0" />
<Label Content="{Binding Duration}" Margin="8,0,0,0" />
</StackPanel>
@@ -234,8 +262,10 @@ <StackPanel Margin="5,5,5,5" Orientation="Vertical">
<GroupBox Header="Presets" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<StackPanel Orientation="Vertical">
- <TreeView ItemsSource="{Binding Presets}" Width="240" Height="460">
+ <TreeView ItemsSource="{Binding Source={StaticResource presetsCvs}, Path=Groups}"
+ ItemTemplate="{StaticResource presetsCategoryTemplate}" Width="240" Height="460"
+ >
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectedItemChanged">
<Micro:ActionMessage MethodName="SetSelectedPreset">
|