diff options
author | Eric Maupin <ermaup@microsoft.com> | 2018-11-16 22:43:43 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2018-12-11 00:07:27 +0300 |
commit | 6bcf516b780bf4b29a89bf124c612ef4d4ab5023 (patch) | |
tree | 4d1b6c1749bf797c3aebc310e53d7b2917fa0434 /Xamarin.PropertyEditing.Windows | |
parent | 7654e7b7f124bb320b5337d9b6675e13c9489c0c (diff) |
[Win] Move expander into styles, add rollover
This also removes the default background from the property presenter
itself as its part of the panel. I feel like I had to add this for a
specific reason but it escapes me and I don't see obvious breakage.
Diffstat (limited to 'Xamarin.PropertyEditing.Windows')
-rw-r--r-- | Xamarin.PropertyEditing.Windows/Themes/PropertyEditorPanelStyle.xaml | 60 | ||||
-rw-r--r-- | Xamarin.PropertyEditing.Windows/Themes/Resources.xaml | 36 |
2 files changed, 61 insertions, 35 deletions
diff --git a/Xamarin.PropertyEditing.Windows/Themes/PropertyEditorPanelStyle.xaml b/Xamarin.PropertyEditing.Windows/Themes/PropertyEditorPanelStyle.xaml index 29f7db0..a2053b8 100644 --- a/Xamarin.PropertyEditing.Windows/Themes/PropertyEditorPanelStyle.xaml +++ b/Xamarin.PropertyEditing.Windows/Themes/PropertyEditorPanelStyle.xaml @@ -72,6 +72,66 @@ </Setter> </Style> + <Style TargetType="ToggleButton" x:Key="AdvancedPropertiesToggleButton"> + <Setter Property="OverridesDefaultStyle" Value="True" /> + <Setter Property="Height" Value="14" /> + <Setter Property="Padding" Value="1.5,1,1.5,1" /> + <Setter Property="VerticalAlignment" Value="Stretch" /> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="Foreground" Value="{DynamicResource ToggleItemForegroundBrush}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ToggleButton}"> + <Border x:Name="ExpanderButtonBorder" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{TemplateBinding Background}" DockPanel.Dock="Top"> + <Path x:Name="Chevron" Data="M 0,3 L 5,8 L 10,3" Stroke="{TemplateBinding Foreground}" Width="10" Height="10" StrokeThickness="2" + HorizontalAlignment="Stretch" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsChecked" Value="True"> + <Setter Property="Data" TargetName="Chevron" Value="M 0,8 L 5,3 L 10,8"/> + </Trigger> + <Trigger Property="IsMouseOver" Value="true"> + <Setter Property="Stroke" Value="{DynamicResource ToggleItemMouseOverForegroundBrush}" TargetName="Chevron"/> + </Trigger> + <Trigger Property="IsPressed" Value="true"> + <Setter Property="Stroke" Value="{DynamicResource ToggleItemSelectedForegroundBrush}" TargetName="Chevron"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Background" Value="{DynamicResource AdvancedExpanderMouseOverBackgroundBrush}" /> + <Setter Property="BorderBrush" Value="{DynamicResource AdvancedExpanderMouseOverBorderBrush}" /> + <Setter Property="Foreground" Value="{DynamicResource AdvancedExpanderMouseOverForegroundBrush}" /> + </Trigger> + </Style.Triggers> + </Style> + + <Style TargetType="Expander" x:Key="AdvancedPropertiesExpander"> + <Setter Property="Foreground" Value="{DynamicResource PanelGroupSecondaryForegroundBrush}" /> + <Setter Property="Background" Value="{DynamicResource PanelGroupSecondaryBackgroundBrush}" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="Expander"> + <StackPanel Background="{TemplateBinding Background}"> + <ToggleButton + x:Name="ExpanderButton" DockPanel.Dock="Top" Style="{DynamicResource AdvancedPropertiesToggleButton}" Content="{TemplateBinding Header}" + IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"> + </ToggleButton> + <ContentPresenter x:Name="ExpanderContent" Visibility="Collapsed" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> + </StackPanel> + <ControlTemplate.Triggers> + <Trigger Property="IsExpanded" Value="True"> + <Setter TargetName="ExpanderContent" Property="Visibility" Value="Visible"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <DataTemplate x:Key="PropertyGroupTemplate"> <local:CategoryExpander Header="{Binding Key,Mode=OneTime}" Style="{StaticResource TreeExpanderStyle}"> <ItemsControl Style="{StaticResource PropertyListStyle}" ItemsSource="{Binding}"> diff --git a/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml b/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml index 4ae48b6..9932fd2 100644 --- a/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml +++ b/Xamarin.PropertyEditing.Windows/Themes/Resources.xaml @@ -702,7 +702,7 @@ </StackPanel> </Border> <Border Padding="1" Visibility="{Binding TargetPlatform.SupportsBrushOpacity, Mode=OneTime, Converter={StaticResource BoolToVisibilityConverter}}"> - <Expander Name="advancedPropertyPanel" Template="{DynamicResource AdvancedPropertiesExpander}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" + <Expander Name="advancedPropertyPanel" Style="{DynamicResource AdvancedPropertiesExpander}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Background="{DynamicResource PanelGroupSecondaryBackgroundBrush}" Foreground="{DynamicResource PanelForegroundBrush}"> <Expander.Content> <Border Padding="19,6,6,6" Background="{DynamicResource PanelGroupSecondaryBackgroundBrush}"> @@ -1489,7 +1489,6 @@ </Style> <Style TargetType="local:PropertyPresenter"> - <Setter Property="Background" Value="{DynamicResource PanelBackgroundBrush}" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:PropertyPresenter"> @@ -1541,39 +1540,6 @@ </Style.Triggers> </Style> - <ControlTemplate TargetType="Expander" x:Key="AdvancedPropertiesExpander"> - <StackPanel Background="{DynamicResource PanelGroupSecondaryBackgroundBrush}"> - <ToggleButton - x:Name="ExpanderButton" DockPanel.Dock="Top" Template="{DynamicResource AdvancedPropertiesToggleButton}" Content="{TemplateBinding Header}" VerticalAlignment="Stretch" - IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" OverridesDefaultStyle="True" Height="14" Padding="1.5,1,1.5,1"> - </ToggleButton> - <ContentPresenter x:Name="ExpanderContent" Grid.Row="1" Visibility="Collapsed" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/> - </StackPanel> - <ControlTemplate.Triggers> - <Trigger Property="IsExpanded" Value="True"> - <Setter TargetName="ExpanderContent" Property="Visibility" Value="Visible"/> - </Trigger> - </ControlTemplate.Triggers> - </ControlTemplate> - - <ControlTemplate x:Key="AdvancedPropertiesToggleButton" TargetType="{x:Type ToggleButton}"> - <Border x:Name="ExpanderButtonBorder" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{DynamicResource PanelGroupSecondaryBackgroundBrush}" DockPanel.Dock="Top"> - <Path x:Name="Chevron" Data="M 0,3 L 5,8 L 10,3" Stroke="{DynamicResource ToggleItemForegroundBrush}" Width="10" Height="10" StrokeThickness="2" - HorizontalAlignment="Stretch" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5"/> - </Border> - <ControlTemplate.Triggers> - <Trigger Property="IsChecked" Value="True"> - <Setter Property="Data" TargetName="Chevron" Value="M 0,8 L 5,3 L 10,8"/> - </Trigger> - <Trigger Property="IsMouseOver" Value="true"> - <Setter Property="Stroke" Value="{DynamicResource ToggleItemMouseOverForegroundBrush}" TargetName="Chevron"/> - </Trigger> - <Trigger Property="IsPressed" Value="true"> - <Setter Property="Stroke" Value="{DynamicResource ToggleItemSelectedForegroundBrush}" TargetName="Chevron"/> - </Trigger> - </ControlTemplate.Triggers> - </ControlTemplate> - <Style TargetType="{x:Type TabItem}"> <Setter Property="Foreground" Value="{DynamicResource PanelForegroundBrush}"/> <Setter Property="BorderThickness" Value="1"/> |