-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
111 lines (109 loc) · 4.98 KB
/
MainWindow.xaml
File metadata and controls
111 lines (109 loc) · 4.98 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<wd:Window
x:Class="WPFDevelopers.Samples.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:controls="clr-namespace:WPFDevelopers.Samples.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:example="clr-namespace:WPFDevelopers.Samples.ExampleViews"
xmlns:helpers="clr-namespace:WPFDevelopers.Samples.Helpers"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:local="clr-namespace:WPFDevelopers.Samples"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:WPFDevelopers.Samples.ViewModels"
xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
Title="WPFDevelopers"
Width="{x:Static local:App.Wdith}"
Height="{x:Static local:App.Height}"
Icon="pack://application:,,,/WPFDevelopers.Samples;component/WPFDevelopers.ico"
TitleBarMode="High"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<wd:Window.Effect>
<wd:GrayscaleEffect x:Name="grayscaleEffect" Factor="1" />
</wd:Window.Effect>
<Window.DataContext>
<vm:MainVM />
</Window.DataContext>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<i:InvokeCommandAction Command="{Binding ViewLoaded}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<Grid>
<wd:NotifyIcon Name="WpfNotifyIcon" Title="WPF开发者">
<wd:NotifyIcon.ContextMenu>
<ContextMenu>
<MenuItem
Name="menuItemGrayscale"
Click="Grayscale_Click"
Header="开启灰度" />
<MenuItem Click="SendMessage_Click" Header="托盘消息" />
<MenuItem
Name="menuItemTwink"
Click="Twink_Click"
Header="闪烁" />
<MenuItem Click="About_Click" Header="关于">
<MenuItem.Icon>
<Path
Width="20"
Height="20"
Data="{StaticResource WD.WarningGeometry}"
Fill="{DynamicResource WD.PrimaryBrush}"
Stretch="Uniform" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Click="Quit_Click" Header="退出" />
</ContextMenu>
</wd:NotifyIcon.ContextMenu>
</wd:NotifyIcon>
<Grid Margin="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="150" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid Margin="0,0,3,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<TextBox
Name="PART_MenuTextBox"
wd:ElementHelper.IsClear="True"
wd:ElementHelper.Watermark="Please input">
<i:Interaction.Triggers>
<i:EventTrigger EventName="TextChanged">
<i:InvokeCommandAction Command="{Binding MenuSearchTextChanged}" CommandParameter="{Binding ElementName=PART_MenuTextBox, Path=Text}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</TextBox>
<controls:NavigateMenu
x:Name="NavigateMenu"
Grid.Row="1"
Margin="0,3,0,0"
DisplayMemberPath="Name"
ItemsSource="{Binding NavigateMenuModelList}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding MenuSelectionChangedCommand}" CommandParameter="{Binding ElementName=NavigateMenu, Path=SelectedItem}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</controls:NavigateMenu>
</Grid>
<GridSplitter
Grid.Column="1"
Width="5"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ShowsPreview="True" />
<Border
Grid.Column="2"
Margin="3,0,0,0"
Background="{DynamicResource WD.BackgroundBrush}">
<ContentControl Content="{Binding ControlPanel}" />
<!-- DataContext="{Binding Path=DataContext, RelativeSource={RelativeSource AncestorType=local:MainWindow}}" -->
</Border>
</Grid>
</Grid>
</wd:Window>