-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMainWindow.xaml
243 lines (225 loc) · 13 KB
/
MainWindow.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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<Window x:Class="FishRandomSelector.MainWindow"
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:FishRandomSelector"
mc:Ignorable="d"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}"
Title="FishRandomSelector-主窗口" Height="450" Width="800" Loaded="MainWindowLoaded" WindowStartupLocation="CenterScreen">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="8*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="0"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="LeftArea" Width="0"/>
<ColumnDefinition Width="Auto">
</ColumnDefinition>
<ColumnDefinition Width="9*"/>
</Grid.ColumnDefinitions>
<materialDesign:DrawerHost
Grid.Row="1" Grid.Column="0" Grid.RowSpan="3" Margin="0,50,0,0"
x:Name="DrawerHost"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderThickness="2"
BorderBrush="{DynamicResource MaterialDesignDivider}">
<materialDesign:DrawerHost.LeftDrawerContent>
<ListBox x:Name="Menu" SelectionChanged="Menu_SelectionChanged">
<TextBlock FontSize="20" >基本设置</TextBlock>
<TextBlock FontSize="20">名单编辑</TextBlock>
<TextBlock FontSize="20">导入导出</TextBlock>
<TextBlock FontSize="20">信息</TextBlock>
</ListBox>
</materialDesign:DrawerHost.LeftDrawerContent>
<StackPanel Orientation="Horizontal">
<Button x:Name="OpenMenuButton" Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}" CommandParameter="{x:Static Dock.Left}">
<materialDesign:PackIcon Kind="ChevronRight" />
</Button>
<Frame NavigationUIVisibility="Hidden" x:Name="LeftAreaHost" Source="/Views/SettingPage.xaml" ></Frame>
</StackPanel>
</materialDesign:DrawerHost>
<GridSplitter Grid.Column="1" Grid.Row="0" Grid.RowSpan="3" Width="10" HorizontalAlignment="Center" ShowsPreview="False" Margin="0,0,10,0"/>
<materialDesign:DialogHost IsOpen="False" x:Name="VerifyDialog" Grid.ColumnSpan="2" Grid.RowSpan="3">
<materialDesign:DialogHost.DialogContent>
<Grid Height="100" Width="200">
<Grid.RowDefinitions>
<RowDefinition Height="5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ProgressBar Style="{StaticResource MaterialDesignCircularProgressBar}" Value="35" IsIndeterminate="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<Viewbox Grid.Row="1">
<TextBlock>正在验证</TextBlock>
</Viewbox>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost IsOpen="False" x:Name="VerifyfailedDialog" Grid.ColumnSpan="2" Grid.RowSpan="3">
<materialDesign:DialogHost.DialogContent>
<Grid Height="200" Width="200">
<Grid.RowDefinitions>
<RowDefinition Height="5*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<Button x:Name="VerifyfailedButton" Grid.Row="1" Style="{StaticResource MaterialDesignRaisedLightButton}" ToolTip="点击此按钮将关闭FishRandomselector" Content="确定" Click="VerifyfailedButton_Click" />
<Viewbox Grid.Row="0">
<TextBlock>验证失败</TextBlock>
</Viewbox>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:Flipper x:Name="MainFlipper" Grid.Row="0" Grid.Column="2" Grid.RowSpan="2" IsFlippedChanged="MainFlipper_IsFlippedChanged">
<materialDesign:Flipper.FrontContent>
<materialDesign:Card Grid.Row="0" Grid.Column="2" Background="#03a9f4" Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}" Padding="0" Grid.RowSpan="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="5*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Viewbox Grid.Row="0" Margin="16 16 16 4">
<TextBlock x:Name="MainText" Style="{StaticResource MaterialDesignHeadline5TextBlock}" Text="..." />
</Viewbox>
<Separator Grid.Row="1" Style="{StaticResource MaterialDesignLightSeparator}" />
<Viewbox Grid.Row="2" Margin="16 0 16 8" VerticalAlignment="Center" HorizontalAlignment="Left">
<TextBlock Style="{StaticResource MaterialDesignBody2TextBlock}" Text="FishRandomSelector" />
</Viewbox>
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="16 0 16 8" HorizontalAlignment="Right">
<Button
HorizontalAlignment="Right"
Style="{StaticResource MaterialDesignToolForegroundButton}"
Width="36"
Padding="2 0 2 0"
materialDesign:RippleAssist.IsCentered="True"
Command="{x:Static materialDesign:Flipper.FlipCommand}">
<materialDesign:PackIcon
Kind="People" />
</Button>
<materialDesign:PopupBox HorizontalAlignment="Right" Padding="2 0 2 0">
<StackPanel>
<Button Content="提高概率" Click="Addp" />
<Button Content="降低概率" Click="Subp" />
<Button Content="清空已选择的名单" Click="ClearIsSelected"/>
<CheckBox IsChecked="True" Content="启用动画" x:Name="IsUsingAnimation" Click="ChangeUseAnimation"/>
</StackPanel>
</materialDesign:PopupBox>
</StackPanel>
</Grid>
</materialDesign:Card>
</materialDesign:Flipper.FrontContent>
<materialDesign:Flipper.BackContent>
<Grid>
<materialDesign:Card
Background="#03a9f4"
Foreground="{DynamicResource PrimaryHueDarkForegroundBrush}"
Padding="0"
>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<ListBox x:Name="MorePeopleNameList" Grid.Column="0" Background="White">
</ListBox>
<Separator
Grid.Column="1"
Style="{StaticResource MaterialDesignLightSeparator}" />
<Grid Grid.Column="2" Margin="0,0,-750,0">
<Grid.RowDefinitions>
<RowDefinition Height="3*"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock
x:Name="MorePeopleText"
Style="{StaticResource MaterialDesignHeadline1TextBlock}"
Text="..." HorizontalAlignment="Center" VerticalAlignment="Center" />
<Separator
Grid.Row="1"
Style="{StaticResource MaterialDesignLightSeparator}" />
<Slider
x:Name="PeopleCount"
Minimum="1"
Maximum="50"
Value="0"
TickFrequency="5"/>
<StackPanel Orientation="Horizontal" Margin="0,20,0,0">
<TextBlock >抽取个数:</TextBlock>
<TextBlock Text="{Binding Source={x:Reference Name=PeopleCount} ,Path=Value,StringFormat={}{0:F0}}"></TextBlock>
</StackPanel>
<Button
Grid.Row="2"
HorizontalAlignment="Center"
Style="{StaticResource MaterialDesignToolForegroundButton}"
Width="126"
Padding="2 0 2 0"
materialDesign:RippleAssist.IsCentered="True"
Command="{x:Static materialDesign:Flipper.FlipCommand}" Margin="0,32,0,20" Cursor="Hand">
<materialDesign:PackIcon
Kind="Person" Height="35" Width="40" />
</Button>
</Grid>
</Grid>
</materialDesign:Card>
</Grid>
</materialDesign:Flipper.BackContent>
</materialDesign:Flipper>
<materialDesign:ColorZone
Mode="PrimaryDark"
Padding="16"
CornerRadius="10"
materialDesign:ShadowAssist.ShadowDepth="Depth3"
ClipToBounds="False" Margin="0,0,0,-22" VerticalAlignment="Stretch" d:LayoutOverrides="Height">
<StackPanel
Orientation="Horizontal">
<ToggleButton x:Name="OpenLeftAreaButton" Style="{DynamicResource MaterialDesignHamburgerToggleButton}" Click="OpenLeftAreaButton_Click">
</ToggleButton>
<TextBlock
VerticalAlignment="Center"
Margin="16 0 0 0"
Text="FishRandomSelector" />
</StackPanel>
</materialDesign:ColorZone>
<Grid x:Name="grid" Grid.Column="2" Grid.Row="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button x:Name="SelectButton"
Style="{StaticResource MaterialDesignRaisedButton}"
materialDesign:ButtonProgressAssist.Value="-1"
materialDesign:ButtonProgressAssist.IsIndicatorVisible="True"
materialDesign:ButtonProgressAssist.IsIndeterminate="True"
DataContext="{}"
Grid.Column="1" VerticalAlignment="Center" Height="70" Cursor="Hand" Click="SelectButton_Click" >
<Viewbox>
<TextBlock>抽取</TextBlock>
</Viewbox>
</Button>
<Button Grid.Column="0"
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Width="60" Height="60" Click="PreSelectedPerson" >
<materialDesign:PackIcon
Kind="ArrowLeft" Height="40" Width="40"
/>
</Button>
<Button Grid.Column="2"
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}" Width="60" Height="60" Click="NextSelectedPerson" >
<materialDesign:PackIcon
Kind="ArrowRight" Height="40" Width="40"
/>
</Button>
</Grid>
</Grid>
</Window>