-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
145 lines (145 loc) · 7.4 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
<Window x:Class="WindConfig.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:ViewModel="clr-namespace:WindConfig.ViewModel" mc:Ignorable="d"
Title="WindConfig" Height="300" Width="400" ResizeMode="CanMinimize"
WindowStartupLocation="CenterScreen">
<Window.DataContext>
<ViewModel:MainWindowViewModel />
</Window.DataContext>
<Grid>
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="10">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<GroupBox Grid.Row="0" Margin="0,2,0,2">
<GroupBox.Header>
<Label>窗口 (Window)</Label>
</GroupBox.Header>
<Grid VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="4,2,4,2">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<RadioButton Grid.Column="0" GroupName="Window" Checked="Window_FullScreenMode_Checked"
IsChecked="{Binding Path=IsFullScreenMode}">
全屏 (FullScreen)
</RadioButton>
<RadioButton Grid.Column="1" GroupName="Window" Checked="Window_WindowMode_Checked"
IsChecked="{Binding Path=IsWindowMode}">
窗口 (Window)
</RadioButton>
</Grid>
</GroupBox>
<GroupBox Grid.Row="1" Margin="0,2,0,2">
<GroupBox.Header>
<Label>分辨率 (Resolution)</Label>
</GroupBox.Header>
<Grid VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="4,2,4,2">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<RadioButton Grid.Column="0" GroupName="Resolution" Checked="Resolution_RadioButton1_Checked"
IsChecked="{Binding Path=IsResolution_1}">
800x600
</RadioButton>
<RadioButton Grid.Column="1" GroupName="Resolution" Checked="Resolution_RadioButton2_Checked"
IsChecked="{Binding Path=IsResolution_2}">
1024x768
</RadioButton>
<RadioButton Grid.Column="2" GroupName="Resolution"
IsChecked="{Binding Path=IsCustomResolution}">
自定义 (Custom)
</RadioButton>
</Grid>
</GroupBox>
<Grid Grid.Row="2" Margin="0,2,0,2">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<GroupBox x:Name="CustomResolution" Grid.ColumnSpan="2" Margin="0,2,0,2"
IsEnabled="{Binding Path=IsCustomResolution}">
<GroupBox.Header>
<Label>自定义分辨率 (Custom Resolution)</Label>
</GroupBox.Header>
<Grid VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="2,0,2,0">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Margin="2,0,2,0" VerticalAlignment="Center"
HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Margin="4,0,4,0">
宽 (Width):
</TextBlock>
<TextBox Grid.Column="1">
<TextBox.Text>
<Binding Path="CustomCreationWidth" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<ExceptionValidationRule />
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
</Grid>
<Grid Grid.Column="1" Margin="2,0,2,0" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Margin="4,0,4,0">
高 (Height):
</TextBlock>
<TextBox Grid.Column="1">
<Binding Path="CustomCreationHeight" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<ExceptionValidationRule />
</Binding.ValidationRules>
</Binding>
</TextBox>
</Grid>
</Grid>
</GroupBox>
</Grid>
<Grid Grid.Row="3" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Margin="16">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center"
Click="Registry_Click">
注册表 (Registry)
</Button>
<Button Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"
Click="Start_Click">
开始游戏 (Start)
</Button>
<Button Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center"
Name="Start" Click="FAQ_Click">
常见问题 (FAQ)
</Button>
</Grid>
</Grid>
<TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="10">
<Hyperlink Name="CheckUpdateLink" Cursor="Hand"
NavigateUri="https://github.com/peaceshi/Wind3/"
RequestNavigate="Hyperlink_RequestNavigate">
<Run Text="更新 (Update)" />
</Hyperlink>
</TextBlock>
</Grid>
</Window>