|
|
@ -11,6 +11,8 @@ |
|
|
|
<Geometry x:Key="DownArrowGeometry">M 0 0 L 2 3 L 4 0 Z</Geometry> |
|
|
|
<Geometry x:Key="DownArrowGeometry">M 0 0 L 2 3 L 4 0 Z</Geometry> |
|
|
|
<local:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> |
|
|
|
<local:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Expander --> |
|
|
|
<Style x:Key="ExpanderDownHeaderStyle" |
|
|
|
<Style x:Key="ExpanderDownHeaderStyle" |
|
|
|
TargetType="{x:Type ToggleButton}"> |
|
|
|
TargetType="{x:Type ToggleButton}"> |
|
|
|
<Setter Property="Template"> |
|
|
|
<Setter Property="Template"> |
|
|
@ -75,34 +77,34 @@ |
|
|
|
<Setter Property="Template"> |
|
|
|
<Setter Property="Template"> |
|
|
|
<Setter.Value> |
|
|
|
<Setter.Value> |
|
|
|
<ControlTemplate TargetType="{x:Type Expander}"> |
|
|
|
<ControlTemplate TargetType="{x:Type Expander}"> |
|
|
|
<DockPanel> |
|
|
|
<DockPanel> |
|
|
|
<ToggleButton x:Name="HeaderSite" |
|
|
|
<ToggleButton x:Name="HeaderSite" |
|
|
|
DockPanel.Dock="Top" |
|
|
|
DockPanel.Dock="Top" |
|
|
|
Margin="0" |
|
|
|
Margin="0" |
|
|
|
MinWidth="0" |
|
|
|
MinWidth="0" |
|
|
|
MinHeight="0" |
|
|
|
MinHeight="0" |
|
|
|
Style="{StaticResource ExpanderDownHeaderStyle}" |
|
|
|
Style="{StaticResource ExpanderDownHeaderStyle}" |
|
|
|
IsChecked="{Binding Path=IsExpanded,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" |
|
|
|
IsChecked="{Binding Path=IsExpanded,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" |
|
|
|
Content="{TemplateBinding Header}" |
|
|
|
Content="{TemplateBinding Header}" |
|
|
|
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|
|
|
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|
|
|
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" |
|
|
|
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" |
|
|
|
Foreground="{TemplateBinding Foreground}" |
|
|
|
Foreground="{TemplateBinding Foreground}" |
|
|
|
Padding="{TemplateBinding Padding}" |
|
|
|
Padding="{TemplateBinding Padding}" |
|
|
|
FontFamily="{TemplateBinding FontFamily}" |
|
|
|
FontFamily="{TemplateBinding FontFamily}" |
|
|
|
FontSize="{TemplateBinding FontSize}" |
|
|
|
FontSize="{TemplateBinding FontSize}" |
|
|
|
FontStyle="{TemplateBinding FontStyle}" |
|
|
|
FontStyle="{TemplateBinding FontStyle}" |
|
|
|
FontStretch="{TemplateBinding FontStretch}" |
|
|
|
FontStretch="{TemplateBinding FontStretch}" |
|
|
|
FontWeight="{TemplateBinding FontWeight}" |
|
|
|
FontWeight="{TemplateBinding FontWeight}" |
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> |
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> |
|
|
|
<ContentPresenter x:Name="ExpandSite" |
|
|
|
<ContentPresenter x:Name="ExpandSite" |
|
|
|
DockPanel.Dock="Bottom" |
|
|
|
DockPanel.Dock="Bottom" |
|
|
|
Visibility="Collapsed" |
|
|
|
Visibility="Collapsed" |
|
|
|
Focusable="false" |
|
|
|
Focusable="false" |
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|
|
|
Margin="{TemplateBinding Padding}"/> |
|
|
|
Margin="{TemplateBinding Padding}"/> |
|
|
|
</DockPanel> |
|
|
|
</DockPanel> |
|
|
|
<ControlTemplate.Triggers> |
|
|
|
<ControlTemplate.Triggers> |
|
|
|
<Trigger Property="IsExpanded" |
|
|
|
<Trigger Property="IsExpanded" |
|
|
|
Value="true"> |
|
|
|
Value="true"> |
|
|
@ -120,10 +122,69 @@ |
|
|
|
</Setter.Value> |
|
|
|
</Setter.Value> |
|
|
|
</Setter> |
|
|
|
</Setter> |
|
|
|
</Style> |
|
|
|
</Style> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- CheckBox --> |
|
|
|
|
|
|
|
<SolidColorBrush x:Key="CheckBoxFillNormal" |
|
|
|
|
|
|
|
Color="#F4F4F4"/> |
|
|
|
|
|
|
|
<SolidColorBrush x:Key="CheckBoxStroke" |
|
|
|
|
|
|
|
Color="#8E8F8F"/> |
|
|
|
|
|
|
|
<Style |
|
|
|
|
|
|
|
TargetType="{x:Type CheckBox}"> |
|
|
|
|
|
|
|
<Setter Property="Foreground" |
|
|
|
|
|
|
|
Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> |
|
|
|
|
|
|
|
<Setter Property="Background" |
|
|
|
|
|
|
|
Value="{StaticResource CheckBoxFillNormal}"/> |
|
|
|
|
|
|
|
<Setter Property="BorderBrush" |
|
|
|
|
|
|
|
Value="{StaticResource CheckBoxStroke}"/> |
|
|
|
|
|
|
|
<Setter Property="BorderThickness" |
|
|
|
|
|
|
|
Value="1"/> |
|
|
|
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
|
|
|
<Setter.Value> |
|
|
|
|
|
|
|
<ControlTemplate TargetType="{x:Type CheckBox}"> |
|
|
|
|
|
|
|
<BulletDecorator Background="Transparent" |
|
|
|
|
|
|
|
SnapsToDevicePixels="true"> |
|
|
|
|
|
|
|
<BulletDecorator.Bullet> |
|
|
|
|
|
|
|
<Border Background="Transparent" Padding="4 2"> <!-- To make the CheckBox easier to hit by mouse --> |
|
|
|
|
|
|
|
<aero:BulletChrome Background="Transparent" |
|
|
|
|
|
|
|
BorderBrush="Transparent" |
|
|
|
|
|
|
|
RenderMouseOver="false" |
|
|
|
|
|
|
|
RenderPressed="false" |
|
|
|
|
|
|
|
IsChecked="{TemplateBinding IsChecked}"/> |
|
|
|
|
|
|
|
</Border> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</BulletDecorator.Bullet> |
|
|
|
|
|
|
|
<ContentPresenter Margin="{TemplateBinding Padding}" |
|
|
|
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|
|
|
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
|
|
|
|
RecognizesAccessKey="True" |
|
|
|
|
|
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> |
|
|
|
|
|
|
|
</BulletDecorator> |
|
|
|
|
|
|
|
<ControlTemplate.Triggers> |
|
|
|
|
|
|
|
<Trigger Property="HasContent" |
|
|
|
|
|
|
|
Value="true"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Setter Property="Padding" |
|
|
|
|
|
|
|
Value="4,0,0,0"/> |
|
|
|
|
|
|
|
</Trigger> |
|
|
|
|
|
|
|
<Trigger Property="IsEnabled" |
|
|
|
|
|
|
|
Value="false"> |
|
|
|
|
|
|
|
<Setter Property="Foreground" |
|
|
|
|
|
|
|
Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> |
|
|
|
|
|
|
|
</Trigger> |
|
|
|
|
|
|
|
</ControlTemplate.Triggers> |
|
|
|
|
|
|
|
</ControlTemplate> |
|
|
|
|
|
|
|
</Setter.Value> |
|
|
|
|
|
|
|
</Setter> |
|
|
|
|
|
|
|
</Style> |
|
|
|
</UserControl.Resources> |
|
|
|
</UserControl.Resources> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Visual tree --> |
|
|
|
<!-- Visual tree --> |
|
|
|
|
|
|
|
|
|
|
|
<Grid Background="Transparent"> |
|
|
|
<Grid Background="Transparent"> |
|
|
|
<Grid.RowDefinitions> |
|
|
|
<Grid.RowDefinitions> |
|
|
|
<RowDefinition></RowDefinition> |
|
|
|
<RowDefinition></RowDefinition> |
|
|
@ -175,23 +236,23 @@ |
|
|
|
<DataTemplate> |
|
|
|
<DataTemplate> |
|
|
|
<DockPanel HorizontalAlignment="Stretch" LastChildFill="True"> |
|
|
|
<DockPanel HorizontalAlignment="Stretch" LastChildFill="True"> |
|
|
|
<Image Source="{Binding Image}" Margin="3 2 4 2" DockPanel.Dock="Left" /> |
|
|
|
<Image Source="{Binding Image}" Margin="3 2 4 2" DockPanel.Dock="Left" /> |
|
|
|
<!-- Command of every checkbox is the command on the main DataContext (ContextActionsBulbViewModel) --> |
|
|
|
<!-- Command of every checkbox is the command on the main DataContext (ContextActionsBulbViewModel) --> |
|
|
|
<CheckBox IsChecked="{Binding IsVisible}" VerticalAlignment="Center" DockPanel.Dock="Right" |
|
|
|
<CheckBox IsChecked="{Binding IsVisible}" VerticalAlignment="Center" DockPanel.Dock="Right" |
|
|
|
Command="{Binding Path=DataContext.ActionVisibleChangedCommand, |
|
|
|
Command="{Binding Path=DataContext.ActionVisibleChangedCommand, |
|
|
|
RelativeSource={RelativeSource AncestorType={x:Type local:ContextActionsBulbControl}}}" |
|
|
|
RelativeSource={RelativeSource AncestorType={x:Type local:ContextActionsBulbControl}}}" |
|
|
|
CommandParameter="{Binding}" |
|
|
|
CommandParameter="{Binding}" |
|
|
|
Visibility="{Binding DataContext.IsHiddenActionsExpanded, |
|
|
|
Visibility="{Binding DataContext.IsHiddenActionsExpanded, |
|
|
|
RelativeSource={RelativeSource AncestorType={x:Type local:ContextActionsBulbControl}}, |
|
|
|
RelativeSource={RelativeSource AncestorType={x:Type local:ContextActionsBulbControl}}, |
|
|
|
Converter={StaticResource BoolToVisibilityConverter}}" |
|
|
|
Converter={StaticResource BoolToVisibilityConverter}}" |
|
|
|
Click="CheckBox_Click" |
|
|
|
Click="CheckBox_Click" |
|
|
|
Focusable="False"> |
|
|
|
Focusable="False"> |
|
|
|
</CheckBox> |
|
|
|
</CheckBox> |
|
|
|
<TextBlock Text="{Binding Name}" Margin="0 2 20 2" /> |
|
|
|
<TextBlock Text="{Binding Name}" Margin="0 2 20 2" /> |
|
|
|
</DockPanel> |
|
|
|
</DockPanel> |
|
|
|
</DataTemplate> |
|
|
|
</DataTemplate> |
|
|
|
</local:ContextActionsControl.ItemTemplate> |
|
|
|
</local:ContextActionsControl.ItemTemplate> |
|
|
|
</local:ContextActionsControl> |
|
|
|
</local:ContextActionsControl> |
|
|
|
<Expander x:Name="HiddenActionsExpander" Expanded="Expander_Expanded" |
|
|
|
<Expander x:Name="HiddenActionsExpander" Expanded="Expander_Expanded" |
|
|
|
IsExpanded="{Binding IsHiddenActionsExpanded}" |
|
|
|
IsExpanded="{Binding IsHiddenActionsExpanded}" |
|
|
|
Grid.Row="2" Grid.Column="0" Margin="0"> |
|
|
|
Grid.Row="2" Grid.Column="0" Margin="0"> |
|
|
|
<local:ContextActionsControl x:Name="HiddenActionsTreeView" |
|
|
|
<local:ContextActionsControl x:Name="HiddenActionsTreeView" |
|
|
@ -205,7 +266,7 @@ |
|
|
|
RelativeSource={RelativeSource AncestorType={x:Type local:ContextActionsBulbControl}}}" |
|
|
|
RelativeSource={RelativeSource AncestorType={x:Type local:ContextActionsBulbControl}}}" |
|
|
|
CommandParameter="{Binding}" |
|
|
|
CommandParameter="{Binding}" |
|
|
|
Click="CheckBox_Click" |
|
|
|
Click="CheckBox_Click" |
|
|
|
Focusable="False"></CheckBox> |
|
|
|
Focusable="False"></CheckBox> |
|
|
|
<TextBlock Text="{Binding Name}" Margin="0 2 20 2" /> |
|
|
|
<TextBlock Text="{Binding Name}" Margin="0 2 20 2" /> |
|
|
|
</DockPanel> |
|
|
|
</DockPanel> |
|
|
|
</DataTemplate> |
|
|
|
</DataTemplate> |
|
|
|