CMWTAT_Digital_Edition/CMWTAT_DIGITAL/MainWindow.xaml
TGSAN cd50996311 Upgrade to v2.2.0.1
1.支持自动选择实验性模式的系统版本,并且弹出提示对话框
2.支持通过控制台参数启动(使用--help可以查看详情)
3.While循环内判断逻辑改用比较器,使运行效率提升
4.支持隐藏运行模式(--hide)
5.支持自动激活模式(--auto)
6.程序集改为嵌入式资源静态加载
7.旧版自解压临时目录改为独立临时工作区

Google Translate :
1. Support system edition of automatic selection of experimental mode, and a prompt dialog box pops up.
2. Support to start through the console parameters (use --help to see details)
3. The decision logic in the While Loop uses a comparator to improve the operating efficiency.
4. Support hidden operation mode (--hide).
5. Support automatic activation mode (--auto)
6. Assembly to embedded resources static loading.
7. The old version of the self-extracting temporary directory was changed to a separate temporary workspace.
2018-06-07 21:16:17 +08:00

210 lines
17 KiB
XML

<Window x:Class="CMWTAT_DIGITAL.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:domain="clr-namespace:CMWTAT_DIGITAL.Domain"
xmlns:local="clr-namespace:CMWTAT_DIGITAL"
mc:Ignorable="d"
Title="CMWTAT Digital Edition V2" Height="550" Width="450"
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}"
ResizeMode="NoResize"
d:DataContext="{d:DesignInstance domain:ViewModel, d:IsDesignTimeCreatable=False}"
Icon="CMWTAT.ico"
Closing="Window_Closing"
>
<Grid>
<StackPanel>
<materialDesign:Card Padding="32" Margin="15,15,15,0">
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}"><Run Text="CMWTAT Digital Edition V2"/></TextBlock>
</materialDesign:Card>
<materialDesign:Card Padding="32" Margin="15,15,15,0">
<StackPanel>
<Grid>
<ComboBox x:Name="SystemEditionText" DisplayMemberPath="DisplayOS" VerticalAlignment="Center" Visibility="Visible"/>
<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">
<TextBox.Text>
<Binding Path="SN" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<domain:IsSN ValidatesOnTargetUpdated="True"/>
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
</Grid>
<!--<TextBlock x:Name="SystemEditionText" Style="{DynamicResource MaterialDesignTitleTextBlock}" Text="Checking System" />-->
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Margin="0,30,0,0">
<RadioButton x:Name="AutoRadio" Content="Auto Mode" Margin="30,0,30,0" IsChecked="True" Checked="A_RadioButton_Checked"/>
<RadioButton x:Name="ManualRadio" Content="Manual Mode" Margin="30,0,30,0" Checked="M_RadioButton_Checked"/>
</StackPanel>
</StackPanel>
</materialDesign:Card>
<Button x:Name="actbtn" Content="Activate" Margin="30,30,30,0" VerticalAlignment="Top" Click="Activate_Button_Click" Height="65"/>
<Button x:Name="installbtn" Content="Convert versions (Install Key without Activate)" Margin="30,30,30,0" VerticalAlignment="Top" Click="installbtn_Click" Height="65"/>
</StackPanel>
<Grid x:Name="DialogHostGrid" Visibility="Hidden">
<materialDesign:DialogHost x:Name="DialogWait" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card>
<StackPanel>
<StackPanel Margin="32,24,32,24">
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Loading</TextBlock>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogActProg" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card>
<StackPanel>
<StackPanel Margin="32,24,32,24">
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
<TextBlock x:Name="activatingtext" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,24,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Activating</TextBlock>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogWithCancel" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card>
<StackPanel>
<StackPanel Margin="24,24,24,8">
<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="24,16,24,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Loading</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
CommandParameter="Sample2Cancel"
HorizontalAlignment="Center">CANCEL</Button>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogWithOK" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card>
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Title</TextBlock>
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Hello World</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
CommandParameter="Sample2Cancel"
HorizontalAlignment="Center">OK</Button>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogHelp" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card>
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" Text="Help"></TextBlock>
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" Text="This application now supports the use of console args to startup!&#10;&#10;-a&#9;--auto&#9;&#9;Auto activate.&#10;-h&#9;--hide&#9;&#9;Run with hide mode (Only be worked with -auto).&#10;-e&#9;--expact&#9;&#9;Experimental activation.&#10;-?&#9;--help&#9;&#9;Show this help Dialog."></TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
CommandParameter="Sample2Cancel"
HorizontalAlignment="Center">OK</Button>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogWithExit" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card>
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock x:Name="DialogWithExitTitle" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Error</TextBlock>
<TextBlock x:Name="DialogWithExitText" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Unable to connect to server, program will exit.</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Click="Exit_Button_Click"
HorizontalAlignment="Center">Exit</Button>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogWithOKToCloseDialog" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card>
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock x:Name="DialogWithOKToCloseDialogTitle" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Title</TextBlock>
<TextBlock x:Name="DialogWithOKToCloseDialogText" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="14" >Text</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
HorizontalAlignment="Center">OK</Button>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
<materialDesign:DialogHost x:Name="DialogWithOKToCloseDialogDonate" IsOpen="False">
<materialDesign:DialogHost.DialogContent>
<Grid>
<materialDesign:Card>
<StackPanel>
<StackPanel Margin="16,16,16,8">
<!--<ProgressBar Style="{DynamicResource MaterialDesignCircularProgressBar}" HorizontalAlignment="Center" Margin="0,0,0,0" IsIndeterminate="True" Value="0" VerticalAlignment="Top" Width="32" Height="32" />-->
<TextBlock x:Name="DialogWithOKToCloseDialogDonateTitle" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="16" FontWeight="Bold" >Title</TextBlock>
<TextBlock x:Name="DialogWithOKToCloseDialogDonateText" Style="{DynamicResource MaterialDesignTitleTextBlock}" Margin="0,8,0,0" HorizontalAlignment="Left" VerticalAlignment="Bottom" FontSize="14" >Text</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Orientation="Horizontal" Margin="8,0,8,8">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Click="Donate_Button_Click"
HorizontalAlignment="Center">Thanks developer and donate a dinner</Button>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True"
Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
HorizontalAlignment="Center">Refuse</Button>
</StackPanel>
</StackPanel>
</materialDesign:Card>
</Grid>
</materialDesign:DialogHost.DialogContent>
</materialDesign:DialogHost>
</Grid>
</Grid>
</Window>