|
|
|
|
@ -3,9 +3,13 @@
@@ -3,9 +3,13 @@
|
|
|
|
|
x:Class="ICSharpCode.SharpDevelop.Refactoring.ContextActionsControl" |
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
|
> |
|
|
|
|
xmlns:s="clr-namespace:System;assembly=mscorlib" |
|
|
|
|
xmlns:aero="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"> |
|
|
|
|
|
|
|
|
|
<UserControl.Resources> |
|
|
|
|
<SolidColorBrush x:Key="OuterBorderBrush" Color="#436C82"></SolidColorBrush> |
|
|
|
|
<BitmapImage x:Key="Magnifier" UriSource="magnifier.png" /> |
|
|
|
|
|
|
|
|
|
<Style x:Key="ClearButton" TargetType="Button"> |
|
|
|
|
<Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter> <!-- Disable the dashed focus rectangle --> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
@ -14,22 +18,31 @@
@@ -14,22 +18,31 @@
|
|
|
|
|
To be able to associate actions with TreeViewItems, we use Buttons as content of TreeViewItems. --> |
|
|
|
|
<ControlTemplate TargetType="Button"> |
|
|
|
|
<Border Name="Border" |
|
|
|
|
Padding="4" |
|
|
|
|
Padding="2" |
|
|
|
|
BorderThickness="1" |
|
|
|
|
CornerRadius="1" |
|
|
|
|
BorderBrush="Transparent" |
|
|
|
|
Background="Transparent"> |
|
|
|
|
<ContentPresenter></ContentPresenter> |
|
|
|
|
</Border> |
|
|
|
|
<ControlTemplate.Triggers> |
|
|
|
|
<Trigger Property="IsFocused" Value="True"> |
|
|
|
|
<Setter Property="Background" TargetName="Border" Value="LightBlue"> |
|
|
|
|
<!--<Setter.Value> |
|
|
|
|
<DynamicResource ResourceKey="{x:Static SystemColors.HighlightTextBrushKey}" /> |
|
|
|
|
</Setter.Value>--> |
|
|
|
|
<Trigger Property="IsMouseOver" Value="True"> |
|
|
|
|
<Setter Property="Background" TargetName="Border" Value="#E8F2FF"> |
|
|
|
|
</Setter> |
|
|
|
|
<Setter Property="TextElement.Foreground"> |
|
|
|
|
</Trigger> |
|
|
|
|
<Trigger Property="IsFocused" Value="True"> |
|
|
|
|
<Setter Property="Background" TargetName="Border"> |
|
|
|
|
<Setter.Value> |
|
|
|
|
<DynamicResource ResourceKey="{x:Static SystemColors.HighlightTextBrushKey}" /> |
|
|
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> |
|
|
|
|
<GradientStop Color="#E5F1FF" Offset="0"/> |
|
|
|
|
<GradientStop Color="#D6E9FF" Offset="0.5"/> |
|
|
|
|
</LinearGradientBrush> |
|
|
|
|
</Setter.Value> |
|
|
|
|
<!--<Setter.Value #A3CEFF darker> |
|
|
|
|
<DynamicResource ResourceKey="{x:Static SystemColors.HighlightTextBrushKey}" /> |
|
|
|
|
</Setter.Value>--> |
|
|
|
|
</Setter> |
|
|
|
|
<Setter Property="BorderBrush" TargetName="Border" Value="#4F7AA8" /> |
|
|
|
|
</Trigger> |
|
|
|
|
</ControlTemplate.Triggers> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
@ -38,7 +51,7 @@
@@ -38,7 +51,7 @@
|
|
|
|
|
</Style> |
|
|
|
|
</UserControl.Resources> |
|
|
|
|
|
|
|
|
|
<Grid Background="White"> |
|
|
|
|
<Grid Background="Transparent"> |
|
|
|
|
<Grid.RowDefinitions> |
|
|
|
|
<RowDefinition></RowDefinition> |
|
|
|
|
<RowDefinition></RowDefinition> |
|
|
|
|
@ -46,27 +59,48 @@
@@ -46,27 +59,48 @@
|
|
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
|
<ColumnDefinition></ColumnDefinition> |
|
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
|
<Border Grid.Row="0" Grid.Column="0" BorderThickness="1" BorderBrush="Black" HorizontalAlignment="Left"> |
|
|
|
|
|
|
|
|
|
<!-- Header --> |
|
|
|
|
<Border Grid.Row="0" Grid.Column="0" Padding="4" BorderThickness="1 1 1 0" |
|
|
|
|
BorderBrush="{StaticResource OuterBorderBrush}" HorizontalAlignment="Left"> |
|
|
|
|
<Border.Background> |
|
|
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> |
|
|
|
|
<GradientStop Color="#D6E9FF" Offset="0"/> |
|
|
|
|
<GradientStop Color="#A3CEFF" Offset="0.5"/> |
|
|
|
|
</LinearGradientBrush> |
|
|
|
|
</Border.Background> |
|
|
|
|
<StackPanel Orientation="Horizontal"> |
|
|
|
|
<Image Source="{Binding Image}"></Image> |
|
|
|
|
<TextBlock Text="{Binding Title}"></TextBlock> |
|
|
|
|
</StackPanel> |
|
|
|
|
</Border> |
|
|
|
|
<Border Grid.Row="1" Grid.Column="0" BorderThickness="1" BorderBrush="Black" HorizontalAlignment="Stretch"> |
|
|
|
|
|
|
|
|
|
<!-- Content - TreeView --> |
|
|
|
|
<Border Grid.Row="1" Grid.Column="0" Padding="0 0 8 8"> |
|
|
|
|
<aero:SystemDropShadowChrome> |
|
|
|
|
<Border BorderThickness="1" BorderBrush="{StaticResource OuterBorderBrush}" HorizontalAlignment="Stretch"> |
|
|
|
|
<TreeView ItemsSource="{Binding Actions}" x:Name="TreeView"> |
|
|
|
|
<TreeView.Background> |
|
|
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> |
|
|
|
|
<GradientStop Color="White"/> |
|
|
|
|
</LinearGradientBrush> |
|
|
|
|
</TreeView.Background> |
|
|
|
|
<TreeView.ItemContainerStyle> |
|
|
|
|
<Style TargetType="{x:Type TreeViewItem}"> |
|
|
|
|
<Setter Property="Template"> |
|
|
|
|
<Setter.Value> |
|
|
|
|
<ControlTemplate TargetType="TreeViewItem"> |
|
|
|
|
<StackPanel> |
|
|
|
|
<!-- ActionButtonClick is used just to close the Popup --> |
|
|
|
|
<Button Command="{Binding ActionCommand}" Style="{StaticResource ClearButton}" Click="ActionButtonClick"> |
|
|
|
|
<Border SnapsToDevicePixels="True"> |
|
|
|
|
<ContentPresenter Content="{TemplateBinding HeaderedContentControl.Header}" ContentTemplate="{TemplateBinding HeaderedContentControl.HeaderTemplate}" ContentStringFormat="{TemplateBinding HeaderedItemsControl.HeaderStringFormat}" ContentSource="Header" Name="PART_Header" |
|
|
|
|
HorizontalAlignment="Stretch" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" /> |
|
|
|
|
</Border> |
|
|
|
|
</Button> |
|
|
|
|
<ItemsPresenter Name="ItemsHost" Margin="14 0 0 0" /> |
|
|
|
|
<Border Padding="14 0 0 0"> |
|
|
|
|
<ItemsPresenter Name="ItemsHost" /> |
|
|
|
|
</Border> |
|
|
|
|
</StackPanel> |
|
|
|
|
<ControlTemplate.Triggers> |
|
|
|
|
<!-- Disable collapsing --> |
|
|
|
|
@ -86,14 +120,14 @@
@@ -86,14 +120,14 @@
|
|
|
|
|
</Setter> |
|
|
|
|
<!-- Make all items expanded --> |
|
|
|
|
<Setter Property="IsExpanded" Value="True"></Setter> |
|
|
|
|
<!-- Make items not focusable so that contained button gets focus on Down arrow, not the item --> |
|
|
|
|
<!-- Make items not focusable so that contained button (not the TreeViewItem) gets focus on Down arrow --> |
|
|
|
|
<Setter Property="Focusable" Value="False"></Setter> |
|
|
|
|
<!--<EventSetter Event="GotFocus" Handler="GotFocusHandler"></EventSetter>--> |
|
|
|
|
</Style> |
|
|
|
|
</TreeView.ItemContainerStyle> |
|
|
|
|
<TreeView.ItemTemplate> |
|
|
|
|
<HierarchicalDataTemplate ItemsSource="{Binding ChildActions}"> |
|
|
|
|
<DockPanel HorizontalAlignment="Stretch"> |
|
|
|
|
<Image Source="{Binding Image}" Margin="3 2 4 2" /> |
|
|
|
|
<TextBlock Text="{Binding Name}" Margin="0 2 20 2" /> |
|
|
|
|
<TextBlock Text="{Binding Comment}" Foreground="Gray" TextAlignment="Right" HorizontalAlignment="Right"/> |
|
|
|
|
</DockPanel> |
|
|
|
|
@ -101,5 +135,7 @@
@@ -101,5 +135,7 @@
|
|
|
|
|
</TreeView.ItemTemplate> |
|
|
|
|
</TreeView> |
|
|
|
|
</Border> |
|
|
|
|
</aero:SystemDropShadowChrome> |
|
|
|
|
</Border> |
|
|
|
|
</Grid> |
|
|
|
|
</UserControl> |