MainWindow.xaml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <Window
  2. x:Class="AILicenseGenerator.MainWindow"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:extensions="clr-namespace:AILicenseGenerator.Extensions"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. Title="AILicenseGenerator"
  9. Width="800"
  10. Height="450"
  11. mc:Ignorable="d">
  12. <Grid>
  13. <Grid.RowDefinitions>
  14. <RowDefinition Height="*" />
  15. <RowDefinition Height="50" />
  16. </Grid.RowDefinitions>
  17. <DataGrid
  18. x:Name="FunctionDataGrid"
  19. Grid.Row="0"
  20. Margin="10"
  21. AutoGenerateColumns="False">
  22. <DataGrid.Columns>
  23. <DataGridTemplateColumn Width="Auto" Header="功能名称">
  24. <DataGridTemplateColumn.CellTemplate>
  25. <DataTemplate>
  26. <TextBlock
  27. Margin="10,0,10,0"
  28. Text="{Binding FunctionName, Converter={extensions:TranslaterConverter}}"
  29. TextWrapping="Wrap" />
  30. </DataTemplate>
  31. </DataGridTemplateColumn.CellTemplate>
  32. </DataGridTemplateColumn>
  33. <DataGridTemplateColumn Width="Auto" Header="版本">
  34. <DataGridTemplateColumn.CellTemplate>
  35. <DataTemplate>
  36. <TextBlock
  37. Margin="10,0,10,0"
  38. Text="{Binding Version}"
  39. TextWrapping="Wrap" />
  40. </DataTemplate>
  41. </DataGridTemplateColumn.CellTemplate>
  42. </DataGridTemplateColumn>
  43. <DataGridTemplateColumn Width="Auto" Header="是否启用">
  44. <DataGridTemplateColumn.CellTemplate>
  45. <DataTemplate>
  46. <CheckBox Margin="10,0,10,0" IsChecked="{Binding IsEnabled, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
  47. </DataTemplate>
  48. </DataGridTemplateColumn.CellTemplate>
  49. </DataGridTemplateColumn>
  50. <DataGridTemplateColumn Width="Auto" Header="有效期">
  51. <DataGridTemplateColumn.CellTemplate>
  52. <DataTemplate>
  53. <TextBlock
  54. Margin="10,0,10,0"
  55. Text="{Binding ExpiredTime}"
  56. TextWrapping="Wrap" />
  57. </DataTemplate>
  58. </DataGridTemplateColumn.CellTemplate>
  59. </DataGridTemplateColumn>
  60. <DataGridTemplateColumn Width="Auto" Header="引擎">
  61. <DataGridTemplateColumn.CellTemplate>
  62. <DataTemplate>
  63. <DataGrid
  64. Margin="10"
  65. AutoGenerateColumns="False"
  66. ItemsSource="{Binding Engines}">
  67. <DataGrid.Columns>
  68. <DataGridTemplateColumn Width="Auto" Header="引擎名称">
  69. <DataGridTemplateColumn.CellTemplate>
  70. <DataTemplate>
  71. <TextBlock
  72. Margin="10,0,10,0"
  73. Text="{Binding EngineName, Converter={extensions:TranslaterConverter}}"
  74. TextWrapping="Wrap" />
  75. </DataTemplate>
  76. </DataGridTemplateColumn.CellTemplate>
  77. </DataGridTemplateColumn>
  78. <DataGridTemplateColumn Width="Auto" Header="版本">
  79. <DataGridTemplateColumn.CellTemplate>
  80. <DataTemplate>
  81. <TextBlock
  82. Margin="10,0,10,0"
  83. Text="{Binding Version}"
  84. TextWrapping="Wrap" />
  85. </DataTemplate>
  86. </DataGridTemplateColumn.CellTemplate>
  87. </DataGridTemplateColumn>
  88. <DataGridTemplateColumn Width="Auto" Header="提供方">
  89. <DataGridTemplateColumn.CellTemplate>
  90. <DataTemplate>
  91. <TextBlock
  92. Margin="10,0,10,0"
  93. Text="{Binding Vendor}"
  94. TextWrapping="Wrap" />
  95. </DataTemplate>
  96. </DataGridTemplateColumn.CellTemplate>
  97. </DataGridTemplateColumn>
  98. <DataGridTemplateColumn Width="Auto" Header="是否启用">
  99. <DataGridTemplateColumn.CellTemplate>
  100. <DataTemplate>
  101. <CheckBox Margin="10,0,10,0" IsChecked="{Binding IsEnabled, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
  102. </DataTemplate>
  103. </DataGridTemplateColumn.CellTemplate>
  104. </DataGridTemplateColumn>
  105. </DataGrid.Columns>
  106. </DataGrid>
  107. </DataTemplate>
  108. </DataGridTemplateColumn.CellTemplate>
  109. </DataGridTemplateColumn>
  110. </DataGrid.Columns>
  111. </DataGrid>
  112. <WrapPanel
  113. Grid.Row="1"
  114. HorizontalAlignment="Center"
  115. VerticalAlignment="Center">
  116. <CheckBox
  117. x:Name="AllFunctionEnableCheckBox"
  118. Margin="20,5"
  119. HorizontalAlignment="Center"
  120. VerticalAlignment="Center"
  121. Click="AllFunctionEnable_Click"
  122. Content="启用全部引擎版本"
  123. IsChecked="True" />
  124. <Button
  125. x:Name="FunctionSettingButton"
  126. Width="100"
  127. Height="30"
  128. Margin="20,5"
  129. Click="FunctionSettingButton_Click"
  130. Content="生成配置文件" />
  131. <Button
  132. x:Name="LicenseButton"
  133. Width="100"
  134. Height="30"
  135. Margin="20,5"
  136. Click="LicenseButton_Click"
  137. Content="生成License" />
  138. <Button
  139. x:Name="GenerateButton"
  140. Width="100"
  141. Height="30"
  142. Margin="20,5"
  143. Click="GenerateButton_Click"
  144. Content="全部生成" />
  145. <Button
  146. x:Name="LicenseDecryptButton"
  147. Width="100"
  148. Height="30"
  149. Margin="20,5"
  150. Click="LicenseDecryptButton_Click"
  151. Content="License解密" />
  152. </WrapPanel>
  153. </Grid>
  154. </Window>