-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
TrayIconView.xaml
41 lines (41 loc) · 1.59 KB
/
TrayIconView.xaml
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
<UserControl
x:Class="H.NotifyIcon.Apps.Views.TrayIconView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="using:H.NotifyIcon.Apps.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tb="using:H.NotifyIcon"
mc:Ignorable="d"
>
<UserControl.Resources>
<converters:BoolToImageSourceConverter
x:Key="BoolToImageSourceConverter"
FalseImage="ms-appx:///Assets/Inactive.ico"
TrueImage="ms-appx:///Assets/Red.ico"
/>
</UserControl.Resources>
<tb:TaskbarIcon
x:Name="TrayIcon"
x:FieldModifier="public"
ContextMenuMode="SecondWindow"
IconSource="{x:Bind IsWindowVisible, Converter={StaticResource BoolToImageSourceConverter}}"
LeftClickCommand="{x:Bind ShowHideWindowCommand}"
NoLeftClickDelay="True"
ToolTipText="ToolTip"
>
<tb:TaskbarIcon.ContextFlyout>
<MenuFlyout AreOpenCloseAnimationsEnabled="False">
<MenuFlyoutItem
Command="{x:Bind ShowHideWindowCommand}"
Text="Show/Hide Window"
/>
<MenuFlyoutSeparator />
<MenuFlyoutItem
Command="{x:Bind ExitApplicationCommand}"
Text="Exit"
/>
</MenuFlyout>
</tb:TaskbarIcon.ContextFlyout>
</tb:TaskbarIcon>
</UserControl>