blob: 9517455c47edebc1302c0bf5ae51b1241085a6f8 (
plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
<Window x:Class="WinUI.ToolbarItem"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WinUI"
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
mc:Ignorable="d"
Height="300" Width="300" Visibility="Hidden" Name="Toolbar">
<Window.Resources>
<CollectionViewSource Source="{Binding ElementName=Toolbar, Path=NetworkCollection}" x:Key="KnownNetworks">
<CollectionViewSource.SortDescriptions>
<scm:SortDescription PropertyName="Header" Direction="Ascending"/>
</CollectionViewSource.SortDescriptions>
</CollectionViewSource>
</Window.Resources>
<Grid>
<tb:TaskbarIcon x:Name="MyNotifyIcon"
IconSource="ZeroTierIcon.ico"
ToolTipText="ZeroTier One"
MenuActivation="LeftOrRightClick">
<tb:TaskbarIcon.ContextMenu>
<ContextMenu>
<ContextMenu.ItemsSource>
<CompositeCollection>
<MenuItem Header="Node ID: unknown"
Click="ToolbarItem_NodeIDClicked"
x:Name="nodeIdMenuItem"/>
<Separator/>
<MenuItem Header="Join Network..."
Click="ToolbarItem_JoinNetworkClicked"/>
<MenuItem Header="Show Networks..."
Click="ToolbarItem_ShowNetworksClicked"/>
<Separator/>
<CollectionContainer Collection="{Binding Source={StaticResource KnownNetworks}}">
</CollectionContainer>
<Separator/>
<MenuItem Header="ZeroTier Central"
Click="ToolbarItem_CentralClicked"/>
<MenuItem Header="Create and Join Network"
Click="ToolbarItem_NewNetwork"
x:Name="newNetworkItem"/>
<Separator/>
<MenuItem Header="About..."
Click="ToolbarItem_AboutClicked"/>
<MenuItem Header="Preferences..."
Click="ToolbarItem_PreferencesClicked"/>
<Separator/>
<MenuItem Header="Quit"
Click="ToolbarItem_QuitClicked"/>
</CompositeCollection>
</ContextMenu.ItemsSource>
</ContextMenu>
</tb:TaskbarIcon.ContextMenu>
</tb:TaskbarIcon>
</Grid>
</Window>
|