WPF NotifyIcon

--------------
CHG   Generally improved sample project - added more bindings, welcome balloon, changed layout.
CHG   Changed namespace in sample project. Preparing tutorials.

git-svn-id: https://svn.evolvesoftware.ch/repos/evolve.net/WPF/NotifyIcon@101 9f600761-6f11-4665-b6dc-0185e9171623
This commit is contained in:
Philipp Sumi
2009-05-13 09:32:55 +00:00
parent 34c589eac4
commit f349d3d339
25 changed files with 612 additions and 197 deletions

View File

@@ -1,8 +1,8 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Commands="clr-namespace:Sample_Project.Commands"
xmlns:tb="clr-namespace:Hardcodet.Wpf.TaskbarNotification;assembly=Hardcodet.Wpf.TaskbarNotification"
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"/>
@@ -15,20 +15,33 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">
<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>
<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 taskbar context menu - the first row is a dummy to show of simple data binding -->
<ContextMenu
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 Main Window"
Command="{Commands:ShowMainWindowCommand}">