Console.xaml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <Window x:Class="PRSLicensing.Console"
  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:local="clr-namespace:PRSLicensing"
  7. xmlns:console="clr-namespace:InABox.Wpf.Console;assembly=InABox.Wpf"
  8. xmlns:dg="clr-namespace:InABox.DynamicGrid;assembly=InABox.Wpf"
  9. xmlns:wpf="clr-namespace:InABox.WPF;assembly=InABox.Wpf"
  10. mc:Ignorable="d"
  11. Title="PRS Licensing Engine" Height="600" Width="1200"
  12. x:Name="Window"
  13. Loaded="Window_Loaded">
  14. <Window.Resources>
  15. <wpf:BooleanToBooleanConverter x:Key="Inverted" Invert="True"/>
  16. <wpf:BooleanToBrushConverter x:Key="NormalColor" TrueValue="LightGreen" FalseValue="WhiteSmoke"/>
  17. <wpf:BooleanToBrushConverter x:Key="InvertedColor" TrueValue="WhiteSmoke" FalseValue="LightGreen"/>
  18. <wpf:BooleanToImageSourceConverter x:Key="InstalledImage" TrueValue="../Resources/uninstall.png" FalseValue="../Resources/install.png"/>
  19. <wpf:BooleanToStringConverter x:Key="InstalledText" TrueValue="Uninstall" FalseValue="Install"/>
  20. <wpf:BooleanToImageSourceConverter x:Key="RunningImage" TrueValue="../Resources/stop.png" FalseValue="../Resources/start.png"/>
  21. <wpf:BooleanToStringConverter x:Key="RunningText" TrueValue="Stop" FalseValue="Start"/>
  22. </Window.Resources>
  23. <dg:DynamicSplitPanel View="Combined" AllowableViews="Combined" Anchor="Master" AnchorWidth="130"
  24. Margin="5,5,5,0"
  25. DataContext="{Binding ElementName=Window}">
  26. <dg:DynamicSplitPanel.Header>
  27. <Border BorderBrush="Gray" BorderThickness="0.75" Background="WhiteSmoke" Padding="0" Margin="0,0,0,0">
  28. <Label x:Name="ServiceName" Content="Service Manager" HorizontalContentAlignment="Center"
  29. VerticalContentAlignment="Center" />
  30. </Border>
  31. </dg:DynamicSplitPanel.Header>
  32. <dg:DynamicSplitPanel.Master>
  33. <Border Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.75" Margin="0,2,0,5" >
  34. <Grid>
  35. <Grid.RowDefinitions>
  36. <RowDefinition Height="Auto"/>
  37. <RowDefinition Height="Auto"/>
  38. <RowDefinition Height="Auto"/>
  39. <RowDefinition Height="*"/>
  40. <RowDefinition Height="Auto"/>
  41. </Grid.RowDefinitions>
  42. <Button x:Name="InstallButton"
  43. Click="InstallButton_Click"
  44. Padding="4"
  45. Grid.Row="0"
  46. BorderThickness="0"
  47. Background="Transparent"
  48. HorizontalAlignment="Stretch"
  49. HorizontalContentAlignment="Stretch"
  50. IsEnabled="{Binding IsRunning, Converter={StaticResource Inverted}}">
  51. <Button.Content>
  52. <Border
  53. CornerRadius="5"
  54. Background="{Binding IsRunning, Converter={StaticResource InvertedColor}}"
  55. BorderBrush="Gray"
  56. BorderThickness="0.75"
  57. Padding="10"
  58. HorizontalAlignment="Stretch"
  59. VerticalAlignment="Stretch">
  60. <StackPanel
  61. Orientation="Vertical"
  62. VerticalAlignment="Center"
  63. HorizontalAlignment="Center" >
  64. <Image Source="{Binding IsInstalled, Converter={StaticResource InstalledImage}}" Height="40" Width="40"/>
  65. <Label Content="{Binding IsInstalled, Converter={StaticResource InstalledText}}"/>
  66. </StackPanel>
  67. </Border>
  68. </Button.Content>
  69. </Button>
  70. <Button x:Name="EditButton"
  71. Click="EditButton_Click"
  72. IsEnabled="{Binding IsRunning, Converter={StaticResource Inverted}}"
  73. Padding="4"
  74. Grid.Row="1"
  75. BorderThickness="0"
  76. Background="Transparent"
  77. HorizontalAlignment="Stretch"
  78. HorizontalContentAlignment="Stretch">
  79. <Button.Content>
  80. <Border
  81. CornerRadius="5"
  82. Background="{Binding IsRunning, Converter={StaticResource InvertedColor}}"
  83. BorderBrush="Gray"
  84. BorderThickness="0.75"
  85. Padding="10"
  86. HorizontalAlignment="Stretch"
  87. VerticalAlignment="Stretch">
  88. <StackPanel
  89. Orientation="Vertical"
  90. VerticalAlignment="Center"
  91. HorizontalAlignment="Center" >
  92. <Image Source="../Resources/settings.png" Height="40" Width="40"/>
  93. <Label Content="Settings" />
  94. </StackPanel>
  95. </Border>
  96. </Button.Content>
  97. </Button>
  98. <Button x:Name="StartButton"
  99. Click="StartButton_Click"
  100. Padding="4"
  101. Grid.Row="2"
  102. BorderThickness="0"
  103. Background="Transparent"
  104. HorizontalAlignment="Stretch"
  105. HorizontalContentAlignment="Stretch"
  106. IsEnabled="{Binding IsInstalled}">
  107. <Button.Content>
  108. <Border
  109. CornerRadius="5"
  110. Background="{Binding IsInstalled, Converter={StaticResource NormalColor}}"
  111. BorderBrush="Gray"
  112. BorderThickness="0.75"
  113. Padding="10"
  114. HorizontalAlignment="Stretch"
  115. VerticalAlignment="Stretch">
  116. <StackPanel
  117. Orientation="Vertical"
  118. VerticalAlignment="Center"
  119. HorizontalAlignment="Center" >
  120. <Image Source="{Binding IsRunning, Converter={StaticResource RunningImage}}" Height="40" Width="40" />
  121. <Label Content="{Binding IsRunning, Converter={StaticResource RunningText}}"/>
  122. </StackPanel>
  123. </Border>
  124. </Button.Content>
  125. </Button>
  126. <Button x:Name="GenerateButton"
  127. Click="GenerateButton_Click"
  128. IsEnabled="{Binding HasDbServer}"
  129. Padding="4"
  130. Grid.Row="4"
  131. BorderThickness="0"
  132. Background="Transparent"
  133. HorizontalAlignment="Stretch"
  134. HorizontalContentAlignment="Stretch">
  135. <Button.Content>
  136. <Border
  137. CornerRadius="5"
  138. Background="{Binding HasDbServer, Converter={StaticResource NormalColor}}"
  139. BorderBrush="Gray"
  140. BorderThickness="0.75"
  141. Padding="10"
  142. HorizontalAlignment="Stretch"
  143. VerticalAlignment="Stretch">
  144. <StackPanel
  145. Orientation="Vertical"
  146. VerticalAlignment="Center"
  147. HorizontalAlignment="Center" >
  148. <Image Source="../Resources/generate.png" Height="40" Width="40"/>
  149. <Label Content="Generate" />
  150. </StackPanel>
  151. </Border>
  152. </Button.Content>
  153. </Button>
  154. </Grid>
  155. </Border>
  156. </dg:DynamicSplitPanel.Master>
  157. <dg:DynamicSplitPanel.DetailHeader>
  158. <Border BorderBrush="Gray" BorderThickness="0.75" Background="WhiteSmoke">
  159. <Label Content="Console" HorizontalContentAlignment="Center"
  160. VerticalContentAlignment="Center" />
  161. </Border>
  162. </dg:DynamicSplitPanel.DetailHeader>
  163. <dg:DynamicSplitPanel.Detail>
  164. <console:ConsoleControl x:Name="ConsoleControl"
  165. Enabled="{Binding IsRunning}"
  166. Margin="-5,5,-5,0"
  167. AllowLoadLogButton="False"/>
  168. </dg:DynamicSplitPanel.Detail>
  169. </dg:DynamicSplitPanel>
  170. </Window>