mirror of
https://github.com/ckaczor/wpf-notifyicon.git
synced 2026-01-14 01:25:45 -05:00
81 lines
3.4 KiB
XML
81 lines
3.4 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:Commands="clr-namespace:Samples.Commands"
|
|
xmlns:tb="http://www.hardcodet.net/taskbar">
|
|
<LinearGradientBrush x:Key="MenuBackground"
|
|
EndPoint="0.5,1"
|
|
StartPoint="0.5,0">
|
|
<GradientStop Color="#FFFFD892"
|
|
Offset="1" />
|
|
<GradientStop Color="#FFFFF3DD"
|
|
Offset="0.259" />
|
|
</LinearGradientBrush>
|
|
|
|
|
|
<Style TargetType="{x:Type ContextMenu}">
|
|
<Setter Property="BorderThickness"
|
|
Value="1,1,1,1" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ContextMenu}">
|
|
<Grid>
|
|
<Border Background="{DynamicResource MenuBackground}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}">
|
|
<ScrollViewer
|
|
Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}"
|
|
Uid="ScrollViewer_9"
|
|
CanContentScroll="True">
|
|
<ItemsPresenter Margin="{TemplateBinding Padding}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
KeyboardNavigation.DirectionalNavigation="Cycle" />
|
|
</ScrollViewer>
|
|
</Border>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
|
|
<!-- The taskbar context menu - the first row is a dummy to show off simple data binding -->
|
|
<!--
|
|
The "shared" directive is needed if we reopen the sample window a few times - WPF will otherwise
|
|
reuse the same context menu (which is a resource) again (which will have its DataContext set to the old TaskbarIcon)
|
|
-->
|
|
<ContextMenu x:Shared="false"
|
|
x:Key="tbMenu">
|
|
<MenuItem IsEnabled="False"
|
|
Header="{Binding Path=ToolTipText}">
|
|
<MenuItem.Icon>
|
|
<Image Width="16"
|
|
Height="16"
|
|
Source="{Binding Path=IconSource}" />
|
|
</MenuItem.Icon>
|
|
</MenuItem>
|
|
|
|
<MenuItem Header="Show Showcase Window"
|
|
Command="{Commands:ShowSampleWindowCommand}"
|
|
CommandParameter="{Binding}">
|
|
<MenuItem.Icon>
|
|
<Image Width="16"
|
|
Height="16"
|
|
Source="/Images/Add.png" />
|
|
</MenuItem.Icon>
|
|
</MenuItem>
|
|
|
|
<Separator />
|
|
|
|
<MenuItem Header="Hide Showcase Window"
|
|
Command="{Commands:HideSampleWindowCommand}"
|
|
CommandParameter="{Binding}">
|
|
<MenuItem.Icon>
|
|
<Image Width="16"
|
|
Height="16"
|
|
Source="/Images/Remove.png" />
|
|
</MenuItem.Icon>
|
|
</MenuItem>
|
|
</ContextMenu>
|
|
|
|
|
|
</ResourceDictionary> |