MainWindow.xaml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <Window x:Class="CmwtatDigital.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:domain="clr-namespace:CmwtatDigital.Domain"
  7. xmlns:local="clr-namespace:CmwtatDigital"
  8. mc:Ignorable="d"
  9. Title="{DynamicResource TitleName}" Height="645" Width="450"
  10. ResizeMode="NoResize"
  11. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  12. TextElement.Foreground="{DynamicResource MaterialDesignBody}"
  13. TextElement.FontWeight="Regular"
  14. TextElement.FontSize="13"
  15. TextOptions.TextFormattingMode="Ideal"
  16. TextOptions.TextRenderingMode="Aliased"
  17. Background="{DynamicResource MaterialDesignPaper}"
  18. d:DataContext="{d:DesignInstance domain:ViewModel, d:IsDesignTimeCreatable=False}"
  19. Icon="CMWTAT.ico"
  20. Closing="Window_Closing"
  21. FontFamily="{DynamicResource Font}"
  22. Activated="Window_Activated"
  23. WindowStartupLocation="CenterScreen"
  24. >
  25. <!--FontFamily="{DynamicResource MaterialDesignFont}"-->
  26. <Grid>
  27. <Grid Margin="30,30,30,30" VerticalAlignment="Center">
  28. <StackPanel>
  29. <materialDesign:Card Padding="30" Margin="0,0,0,0" materialDesign:ShadowAssist.ShadowDepth="Depth3" UniformCornerRadius="8">
  30. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" ><Run Text="{DynamicResource AppName}"/></TextBlock>
  31. </materialDesign:Card>
  32. <materialDesign:Card Padding="30,30" Margin="0,30,0,0" materialDesign:ShadowAssist.ShadowDepth="Depth3" UniformCornerRadius="8">
  33. <StackPanel>
  34. <Grid>
  35. <ComboBox x:Name="SystemEditionText" DisplayMemberPath="DisplayOS" VerticalAlignment="Center" Visibility="Visible"/>
  36. <TextBox x:Name="SystemEditionTextInput" materialDesign:HintAssist.Hint="XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" MaxLength="29" xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore" input:InputMethod.IsInputMethodEnabled="False" VerticalAlignment="Center" Visibility="Hidden" TextChanged="SystemEditionTextInput_TextChanged">
  37. <TextBox.Text>
  38. <Binding Path="SN" UpdateSourceTrigger="PropertyChanged">
  39. <Binding.ValidationRules>
  40. <domain:IsSN ValidatesOnTargetUpdated="True"/>
  41. </Binding.ValidationRules>
  42. </Binding>
  43. </TextBox.Text>
  44. </TextBox>
  45. </Grid>
  46. <!--<TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" x:Name="SystemEditionText" Text="Checking System" />-->
  47. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Margin="0,30,0,0">
  48. <RadioButton x:Name="AutoRadio" Content="{DynamicResource Auto_Mode}" Margin="30,0,30,0" IsChecked="True" Checked="A_RadioButton_Checked"/>
  49. <RadioButton x:Name="ManualRadio" Content="{DynamicResource Manual_Mode}" Margin="30,0,30,0" Checked="M_RadioButton_Checked"/>
  50. </StackPanel>
  51. </StackPanel>
  52. </materialDesign:Card>
  53. <Button FontFamily="{DynamicResource Font}" x:Name="actbtn" Click="Activate_Button_Click" Content="{DynamicResource Activate_Button}" materialDesign:ShadowAssist.ShadowDepth="Depth3" materialDesign:ShadowAssist.Darken="False" materialDesign:ButtonAssist.CornerRadius="8" Margin="0,30,0,0" Height="65" Cursor="Hand" />
  54. <Button FontFamily="{DynamicResource Font}" x:Name="installbtn" Click="installbtn_Click" Content="{DynamicResource Convert_versions}" materialDesign:ShadowAssist.ShadowDepth="Depth3" materialDesign:ShadowAssist.Darken="False" materialDesign:ButtonAssist.CornerRadius="8" Margin="0,30,0,0" Height="65" Cursor="Hand"/>
  55. <Button FontFamily="{DynamicResource Font}" x:Name="upgradefullbtn" Click="upgradefullbtn_Click" Content="{DynamicResource Upgrade_full_version}" materialDesign:ShadowAssist.ShadowDepth="Depth3" materialDesign:ShadowAssist.Darken="False" materialDesign:ButtonAssist.CornerRadius="8" Margin="0,30,0,0" Height="65" Cursor="Hand"/>
  56. </StackPanel>
  57. </Grid>
  58. <Grid x:Name="DialogHostGrid" Visibility="Hidden">
  59. <materialDesign:DialogHost x:Name="DialogWait" IsOpen="False">
  60. <materialDesign:DialogHost.DialogContent>
  61. <Grid>
  62. <materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
  63. <StackPanel>
  64. <StackPanel Margin="32,24,32,24">
  65. <ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
  66. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Loading}" />
  67. </StackPanel>
  68. </StackPanel>
  69. </materialDesign:Card>
  70. </Grid>
  71. </materialDesign:DialogHost.DialogContent>
  72. </materialDesign:DialogHost>
  73. <materialDesign:DialogHost x:Name="DialogActProg" IsOpen="False">
  74. <materialDesign:DialogHost.DialogContent>
  75. <Grid>
  76. <materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
  77. <StackPanel>
  78. <StackPanel Margin="32,24,32,24">
  79. <ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
  80. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="activatingtext" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Activating}" />
  81. </StackPanel>
  82. </StackPanel>
  83. </materialDesign:Card>
  84. </Grid>
  85. </materialDesign:DialogHost.DialogContent>
  86. </materialDesign:DialogHost>
  87. <materialDesign:DialogHost x:Name="DialogWithCancel" IsOpen="False">
  88. <materialDesign:DialogHost.DialogContent>
  89. <Grid>
  90. <materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
  91. <StackPanel>
  92. <StackPanel Margin="24,24,24,8">
  93. <ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
  94. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="24,16,24,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Loading}" />
  95. </StackPanel>
  96. <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
  97. <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
  98. Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
  99. CommandParameter="Sample2Cancel"
  100. HorizontalAlignment="Center" Content="{DynamicResource Cancel}" />
  101. </StackPanel>
  102. </StackPanel>
  103. </materialDesign:Card>
  104. </Grid>
  105. </materialDesign:DialogHost.DialogContent>
  106. </materialDesign:DialogHost>
  107. <materialDesign:DialogHost x:Name="DialogWithOK" IsOpen="False">
  108. <materialDesign:DialogHost.DialogContent>
  109. <Grid>
  110. <materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
  111. <StackPanel>
  112. <StackPanel Margin="16,16,16,8">
  113. <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
  114. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Title" />
  115. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="Hello World" />
  116. </StackPanel>
  117. <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
  118. <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
  119. Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
  120. CommandParameter="Sample2Cancel"
  121. HorizontalAlignment="Center" Content="{DynamicResource OK}" />
  122. </StackPanel>
  123. </StackPanel>
  124. </materialDesign:Card>
  125. </Grid>
  126. </materialDesign:DialogHost.DialogContent>
  127. </materialDesign:DialogHost>
  128. <materialDesign:DialogHost x:Name="DialogHelp" IsOpen="False">
  129. <materialDesign:DialogHost.DialogContent>
  130. <Grid>
  131. <materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
  132. <StackPanel>
  133. <StackPanel Margin="16,16,16,8">
  134. <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
  135. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Help"></TextBlock>
  136. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource HelpText}"></TextBlock>
  137. </StackPanel>
  138. <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
  139. <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
  140. Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
  141. CommandParameter="Sample2Cancel"
  142. HorizontalAlignment="Center" Content="{DynamicResource OK}" />
  143. </StackPanel>
  144. </StackPanel>
  145. </materialDesign:Card>
  146. </Grid>
  147. </materialDesign:DialogHost.DialogContent>
  148. </materialDesign:DialogHost>
  149. <materialDesign:DialogHost x:Name="DialogWithExit" IsOpen="False">
  150. <materialDesign:DialogHost.DialogContent>
  151. <Grid>
  152. <materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
  153. <StackPanel>
  154. <StackPanel Margin="16,16,16,8">
  155. <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
  156. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithExitTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource ErrorTitle}"/>
  157. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithExitText" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource Disconnect_to_server_exit}"/>
  158. </StackPanel>
  159. <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
  160. <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
  161. Click="Exit_Button_Click"
  162. HorizontalAlignment="Center" Content="{DynamicResource Exit}"/>
  163. </StackPanel>
  164. </StackPanel>
  165. </materialDesign:Card>
  166. </Grid>
  167. </materialDesign:DialogHost.DialogContent>
  168. </materialDesign:DialogHost>
  169. <materialDesign:DialogHost x:Name="DialogWithOKToCloseDialog" IsOpen="False">
  170. <materialDesign:DialogHost.DialogContent>
  171. <Grid>
  172. <materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
  173. <StackPanel>
  174. <StackPanel Margin="16,16,16,8">
  175. <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
  176. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithOKToCloseDialogTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Title</TextBlock>
  177. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithOKToCloseDialogText" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Text</TextBlock>
  178. </StackPanel>
  179. <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
  180. <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
  181. Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
  182. HorizontalAlignment="Center" Content="{DynamicResource OK}"/>
  183. </StackPanel>
  184. </StackPanel>
  185. </materialDesign:Card>
  186. </Grid>
  187. </materialDesign:DialogHost.DialogContent>
  188. </materialDesign:DialogHost>
  189. <materialDesign:DialogHost x:Name="DialogWithOKToCloseDialogDonate" IsOpen="False">
  190. <materialDesign:DialogHost.DialogContent>
  191. <Grid>
  192. <materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
  193. <StackPanel>
  194. <StackPanel Margin="16,16,16,8">
  195. <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
  196. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithOKToCloseDialogDonateTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource Complete}" />
  197. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogWithOKToCloseDialogDonateText" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource DonateTextActivated}" />
  198. </StackPanel>
  199. <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
  200. <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
  201. Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" HorizontalAlignment="Center" Content="{DynamicResource Refuse}"/>
  202. <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
  203. Click="Donate_Button_Click" HorizontalAlignment="Center" Content="{DynamicResource DonateBtn}"/>
  204. </StackPanel>
  205. </StackPanel>
  206. </materialDesign:Card>
  207. </Grid>
  208. </materialDesign:DialogHost.DialogContent>
  209. </materialDesign:DialogHost>
  210. <materialDesign:DialogHost x:Name="DialogUpdate" IsOpen="False">
  211. <materialDesign:DialogHost.DialogContent>
  212. <Grid>
  213. <materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
  214. <StackPanel>
  215. <StackPanel Margin="16,16,16,8">
  216. <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
  217. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogUpdateTitle" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource UpdateTitle}" />
  218. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignHeadline6TextBlock}" x:Name="DialogUpdateText" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource UpdateText}" />
  219. </StackPanel>
  220. <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
  221. <Button x:Name="IgnoreUpdate" FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
  222. Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" HorizontalAlignment="Center" Content="{DynamicResource Ignore}"/>
  223. <Button x:Name="UpdateBtn" FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
  224. Click="UpdateBtn_Click" HorizontalAlignment="Center" Content="{DynamicResource UpdateNow}"/>
  225. </StackPanel>
  226. </StackPanel>
  227. </materialDesign:Card>
  228. </Grid>
  229. </materialDesign:DialogHost.DialogContent>
  230. </materialDesign:DialogHost>
  231. <materialDesign:DialogHost x:Name="DialogUpgradeFullVersion" IsOpen="False">
  232. <materialDesign:DialogHost.DialogContent>
  233. <Grid>
  234. <materialDesign:Card UniformCornerRadius="8" materialDesign:ShadowAssist.ShadowDepth="Depth3">
  235. <StackPanel>
  236. <StackPanel Margin="16,16,16,8">
  237. <!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
  238. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="{DynamicResource UpgradeFullVersionWindowsTitle}" />
  239. <TextBlock FontFamily="{DynamicResource Font}" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" Text="{DynamicResource UpgradeFullVersionWindowsText}" />
  240. </StackPanel>
  241. <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
  242. <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
  243. Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" HorizontalAlignment="Center" Content="{DynamicResource Cancel}"/>
  244. <Button FontFamily="{DynamicResource Font}" Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
  245. Click="UpgradeFullVersionWindows_Click" HorizontalAlignment="Center" Content="{DynamicResource OK}"/>
  246. </StackPanel>
  247. </StackPanel>
  248. </materialDesign:Card>
  249. </Grid>
  250. </materialDesign:DialogHost.DialogContent>
  251. </materialDesign:DialogHost>
  252. </Grid>
  253. </Grid>
  254. </Window>