forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageButtonCommon.xaml
More file actions
71 lines (68 loc) · 4.4 KB
/
Copy pathImageButtonCommon.xaml
File metadata and controls
71 lines (68 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:controls="clr-namespace:Microsoft.PowerShell.Commands.ShowCommandInternal"
xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">
<!-- ImageButtonBase Start -->
<controls:ImageButtonToolTipConverter x:Key="imageButtonToolTipConverter"/>
<LinearGradientBrush x:Key="ImageButtonPressedBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#BBB" Offset="0.0"/>
<GradientStop Color="#EEE" Offset="0.1"/>
<GradientStop Color="#EEE" Offset="0.9"/>
<GradientStop Color="#FFF" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush x:Key="ImageButtonSelectedBackgroundBrush" Color="#DDD" />
<LinearGradientBrush x:Key="ImageButtonPressedBorderBrush" StartPoint="0,0" EndPoint="0,1">
<GradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Color="#444" Offset="0.0"/>
<GradientStop Color="#888" Offset="1.0"/>
</GradientStopCollection>
</GradientBrush.GradientStops>
</LinearGradientBrush>
<SolidColorBrush x:Key="ImageButtonSolidBorderBrush" Color="#bbbbbb" />
<ControlTemplate x:Key="imageButtonTemplate" TargetType="{x:Type ButtonBase}">
<Grid>
<Border Padding="3,2,3,2" x:Name="Border" BorderBrush="Transparent" BorderThickness="1">
<Grid>
<Image AutomationProperties.Name="enabledImage" x:Name="EnabledImage" Margin="0,0,0,0" Stretch="None" Source="{Binding Path=EnabledImageSource, RelativeSource={RelativeSource AncestorType={x:Type controls:ImageButtonBase}}}"></Image>
<Image AutomationProperties.Name="disabledImage" x:Name="DisabledImage" Margin="0,0,0,0" Stretch="None" Source="{Binding Path=DisabledImageSource, RelativeSource={RelativeSource AncestorType={x:Type controls:ImageButtonBase}}}"></Image>
</Grid>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Visibility" Value="Visible" TargetName="EnabledImage"></Setter>
<Setter Property="Visibility" Value="Collapsed" TargetName="DisabledImage"></Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Visibility" Value="Collapsed" TargetName="EnabledImage"></Setter>
<Setter Property="Visibility" Value="Visible" TargetName="DisabledImage"></Setter>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource ImageButtonSelectedBackgroundBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ImageButtonSolidBorderBrush}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource ImageButtonSelectedBackgroundBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ImageButtonSolidBorderBrush}" />
</Trigger>
<Trigger Property="Button.IsPressed" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource ImageButtonPressedBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ImageButtonPressedBorderBrush}" />
</Trigger>
<Trigger Property="ToggleButton.IsChecked" Value="true">
<Setter TargetName="Border" Property="Background" Value="{StaticResource ImageButtonPressedBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource ImageButtonPressedBorderBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- ImageButtonBase End -->
</ResourceDictionary>