diff options
author | Eric Maupin <me@ermau.com> | 2018-12-14 01:13:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-14 01:13:09 +0300 |
commit | 24f851b9c3abe3cfe86182d2c9151b4ec61c883f (patch) | |
tree | 05d69b3a3beaeea69be4e97359fe8d6ad61e4460 /Xamarin.PropertyEditing.Windows | |
parent | cd248d8fa5306f3ab05fabc72d6e869dd616ba9a (diff) | |
parent | 6ae9f0fbd0a55b6bf9b927b1ae9bb38ed3e0741b (diff) |
Merge pull request #462 from xamarin/ermau-low-freq
Support low-frequency properties
Diffstat (limited to 'Xamarin.PropertyEditing.Windows')
3 files changed, 85 insertions, 44 deletions
diff --git a/Xamarin.PropertyEditing.Windows/PropertyEditorPanel.cs b/Xamarin.PropertyEditing.Windows/PropertyEditorPanel.cs index 90ddb10..3fa7203 100644 --- a/Xamarin.PropertyEditing.Windows/PropertyEditorPanel.cs +++ b/Xamarin.PropertyEditing.Windows/PropertyEditorPanel.cs @@ -210,7 +210,7 @@ namespace Xamarin.PropertyEditing.Windows Binding itemsSource; if (newMode == PropertyArrangeMode.Name) - itemsSource = new Binding ("ArrangedEditors[0]"); + itemsSource = new Binding ("ArrangedEditors[0].Editors"); else itemsSource = new Binding ("ArrangedEditors"); diff --git a/Xamarin.PropertyEditing.Windows/Themes/PropertyEditorPanelStyle.xaml b/Xamarin.PropertyEditing.Windows/Themes/PropertyEditorPanelStyle.xaml index 29f7db0..b479b1d 100644 --- a/Xamarin.PropertyEditing.Windows/Themes/PropertyEditorPanelStyle.xaml +++ b/Xamarin.PropertyEditing.Windows/Themes/PropertyEditorPanelStyle.xaml @@ -72,15 +72,90 @@ </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}"> - <ItemsControl.Template> - <ControlTemplate> - <ItemsPresenter /> - </ControlTemplate> - </ItemsControl.Template> - </ItemsControl> + <local:CategoryExpander Header="{Binding Category,Mode=OneTime}" Style="{StaticResource TreeExpanderStyle}"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <ItemsControl Grid.Row="0" Style="{StaticResource PropertyListStyle}" ItemsSource="{Binding Editors,Mode=OneTime}"> + <ItemsControl.Template> + <ControlTemplate> + <ItemsPresenter /> + </ControlTemplate> + </ItemsControl.Template> + </ItemsControl> + <Expander Grid.Row="1" Visibility="{Binding HasUncommonElements,Converter={StaticResource BoolToVisibilityConverter}}" Style="{StaticResource AdvancedPropertiesExpander}"> + <ItemsControl Grid.Row="0" Style="{StaticResource PropertyListStyle}" ItemsSource="{Binding UncommonEditors,Mode=OneTime}"> + <ItemsControl.Template> + <ControlTemplate> + <ItemsPresenter /> + </ControlTemplate> + </ItemsControl.Template> + </ItemsControl> + </Expander> + </Grid> </local:CategoryExpander> </DataTemplate> 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"/> |