55 lines
3.3 KiB
XML
55 lines
3.3 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:tb="http://www.hardcodet.net/taskbar"
|
|
xmlns:flexitimeTaskbarUtility="clr-namespace:FlexitimeTaskbarUtility"
|
|
xmlns:converters="clr-namespace:FlexitimeTaskbarUtility.Converters"
|
|
xmlns:components="clr-namespace:FlexitimeTaskbarUtility.Components"
|
|
xmlns:viewModels="clr-namespace:FlexitimeTaskbarUtility.ViewModels"
|
|
xmlns:regions="http://prismlibrary.com/"
|
|
xmlns:b="http://schemas.microsoft.com/xaml/behaviors">
|
|
|
|
<!-- 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)
|
|
-->
|
|
|
|
<converters:UserStatusToImageSourceConverter x:Key="UserStatusToImageSourceConverter"/>
|
|
<converters:UserStatusToLoginDialogVisibilityConverter x:Key="UserStatusToLoginDialogVisibilityConverter" />
|
|
<converters:UserStatusToSigninControlVisibilityConverter x:Key="UserStatusToSigninControlVisibilityConverter" />
|
|
|
|
<ContextMenu x:Shared="false" x:Key="SysTrayMenu" >
|
|
<ContextMenu.Template>
|
|
<ControlTemplate>
|
|
<StackPanel Background="WhiteSmoke">
|
|
<ContentControl regions:RegionManager.RegionName="ContextMenuRegion" />
|
|
<!--<components:LoginControl Visibility="{Binding UserStatus, Converter={StaticResource UserStatusToLoginDialogVisibilityConverter}}"/>
|
|
<components:SigninControl Visibility="{Binding UserStatus, Converter={StaticResource UserStatusToSigninControlVisibilityConverter}}"></components:SigninControl>-->
|
|
|
|
<MenuItem Header="Show Window" Command="{Binding ShowWindowCommand}" />
|
|
<MenuItem Header="Hide Window" Command="{Binding HideWindowCommand}" />
|
|
<MenuItem Header="Exit" Command="{Binding ExitApplicationCommand}" />
|
|
</StackPanel>
|
|
</ControlTemplate>
|
|
</ContextMenu.Template>
|
|
</ContextMenu>
|
|
|
|
<!-- the application's NotifyIcon - started from App.xaml.cs. Declares its own view model. -->
|
|
<tb:TaskbarIcon x:Key="NotifyIcon"
|
|
IconSource="{Binding UserStatus, Converter={StaticResource UserStatusToImageSourceConverter}}"
|
|
ToolTipText="Double-click for window, right-click for menu"
|
|
DoubleClickCommand="{Binding ShowWindowCommand}"
|
|
ContextMenu="{StaticResource SysTrayMenu}">
|
|
<b:Interaction.Triggers>
|
|
<b:EventTrigger EventName="TrayContextMenuOpen">
|
|
<b:InvokeCommandAction Command="{Binding TrayContextMenuOpened}"/>
|
|
</b:EventTrigger>
|
|
</b:Interaction.Triggers>
|
|
|
|
<!--self-assign a data context (could also be done programmatically)-->
|
|
<!--<tb:TaskbarIcon.DataContext>
|
|
<viewModels:NotifyIconViewModel />
|
|
</tb:TaskbarIcon.DataContext>-->
|
|
</tb:TaskbarIcon>
|
|
|
|
</ResourceDictionary> |