|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | + |
| 3 | +<UserControl |
| 4 | + x:Class="Coder.Desktop.App.TrayIcon" |
| 5 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 6 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 7 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 8 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 9 | + xmlns:tb="using:H.NotifyIcon" |
| 10 | + mc:Ignorable="d"> |
| 11 | + |
| 12 | + <UserControl.Resources> |
| 13 | + <!-- Icons are used from .cs --> |
| 14 | + <!-- ReSharper disable Xaml.RedundantResource --> |
| 15 | + <BitmapImage x:Key="IconLightTheme" UriSource="ms-appx:///Assets/coder_icon_32_dark.ico" /> |
| 16 | + <BitmapImage x:Key="IconDarkTheme" UriSource="ms-appx:///Assets/coder_icon_32_light.ico" /> |
| 17 | + <!-- ReSharper restore Xaml.RedundantResource --> |
| 18 | + </UserControl.Resources> |
| 19 | + |
| 20 | + <tb:TaskbarIcon |
| 21 | + x:Name="TaskbarIcon" |
| 22 | + Visibility="Visible" |
| 23 | + ToolTipText="Coder" |
| 24 | + ContextMenuMode="SecondWindow" |
| 25 | + LeftClickCommand="{x:Bind OpenCommand}" |
| 26 | + NoLeftClickDelay="True"> |
| 27 | + |
| 28 | + <tb:TaskbarIcon.ContextFlyout> |
| 29 | + <MenuFlyout> |
| 30 | + <MenuFlyoutItem> |
| 31 | + <MenuFlyoutItem.Command> |
| 32 | + <XamlUICommand |
| 33 | + Label="Show Window" |
| 34 | + Description="Show Window" |
| 35 | + Command="{x:Bind OpenCommand}"> |
| 36 | + |
| 37 | + <XamlUICommand.IconSource> |
| 38 | + <SymbolIconSource Symbol="OpenPane" /> |
| 39 | + </XamlUICommand.IconSource> |
| 40 | + <XamlUICommand.KeyboardAccelerators> |
| 41 | + <KeyboardAccelerator |
| 42 | + Key="S" |
| 43 | + Modifiers="Control" /> |
| 44 | + </XamlUICommand.KeyboardAccelerators> |
| 45 | + </XamlUICommand> |
| 46 | + </MenuFlyoutItem.Command> |
| 47 | + </MenuFlyoutItem> |
| 48 | + |
| 49 | + <MenuFlyoutSeparator /> |
| 50 | + |
| 51 | + <MenuFlyoutItem> |
| 52 | + <MenuFlyoutItem.Command> |
| 53 | + <XamlUICommand |
| 54 | + Label="Exit" |
| 55 | + Description="Exit" |
| 56 | + Command="{x:Bind ExitCommand}"> |
| 57 | + |
| 58 | + <XamlUICommand.IconSource> |
| 59 | + <SymbolIconSource Symbol="ClosePane" /> |
| 60 | + </XamlUICommand.IconSource> |
| 61 | + <XamlUICommand.KeyboardAccelerators> |
| 62 | + <KeyboardAccelerator |
| 63 | + Key="E" |
| 64 | + Modifiers="Control" /> |
| 65 | + </XamlUICommand.KeyboardAccelerators> |
| 66 | + </XamlUICommand> |
| 67 | + </MenuFlyoutItem.Command> |
| 68 | + </MenuFlyoutItem> |
| 69 | + </MenuFlyout> |
| 70 | + </tb:TaskbarIcon.ContextFlyout> |
| 71 | + </tb:TaskbarIcon> |
| 72 | +</UserControl> |
0 commit comments