123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <Window x:Class="PRSLicensing.Console"
- 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:local="clr-namespace:PRSLicensing"
- xmlns:console="clr-namespace:InABox.Wpf.Console;assembly=InABox.Wpf"
- xmlns:dg="clr-namespace:InABox.DynamicGrid;assembly=InABox.Wpf"
- xmlns:wpf="clr-namespace:InABox.WPF;assembly=InABox.Wpf"
- mc:Ignorable="d"
- Title="PRS Licensing Engine" Height="600" Width="1200"
- x:Name="Window"
- Loaded="Window_Loaded">
- <Window.Resources>
-
- <wpf:BooleanToBooleanConverter x:Key="Inverted" Invert="True"/>
-
- <wpf:BooleanToBrushConverter x:Key="NormalColor" TrueValue="LightGreen" FalseValue="WhiteSmoke"/>
- <wpf:BooleanToBrushConverter x:Key="InvertedColor" TrueValue="WhiteSmoke" FalseValue="LightGreen"/>
- <wpf:BooleanToImageSourceConverter x:Key="InstalledImage" TrueValue="../Resources/uninstall.png" FalseValue="../Resources/install.png"/>
- <wpf:BooleanToStringConverter x:Key="InstalledText" TrueValue="Uninstall" FalseValue="Install"/>
-
- <wpf:BooleanToImageSourceConverter x:Key="RunningImage" TrueValue="../Resources/stop.png" FalseValue="../Resources/start.png"/>
- <wpf:BooleanToStringConverter x:Key="RunningText" TrueValue="Stop" FalseValue="Start"/>
-
- </Window.Resources>
- <dg:DynamicSplitPanel View="Combined" AllowableViews="Combined" Anchor="Master" AnchorWidth="130"
- Margin="5,5,5,0"
- DataContext="{Binding ElementName=Window}">
- <dg:DynamicSplitPanel.Header>
- <Border BorderBrush="Gray" BorderThickness="0.75" Background="WhiteSmoke" Padding="0" Margin="0,0,0,0">
- <Label x:Name="ServiceName" Content="Service Manager" HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center" />
- </Border>
- </dg:DynamicSplitPanel.Header>
- <dg:DynamicSplitPanel.Master>
- <Border Background="WhiteSmoke" BorderBrush="Gray" BorderThickness="0.75" Margin="0,2,0,5" >
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
- <Button x:Name="InstallButton"
- Click="InstallButton_Click"
- Padding="4"
- Grid.Row="0"
- BorderThickness="0"
- Background="Transparent"
- HorizontalAlignment="Stretch"
- HorizontalContentAlignment="Stretch"
- IsEnabled="{Binding IsRunning, Converter={StaticResource Inverted}}">
- <Button.Content>
- <Border
- CornerRadius="5"
- Background="{Binding IsRunning, Converter={StaticResource InvertedColor}}"
- BorderBrush="Gray"
- BorderThickness="0.75"
- Padding="10"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
- <StackPanel
- Orientation="Vertical"
- VerticalAlignment="Center"
- HorizontalAlignment="Center" >
- <Image Source="{Binding IsInstalled, Converter={StaticResource InstalledImage}}" Height="40" Width="40"/>
- <Label Content="{Binding IsInstalled, Converter={StaticResource InstalledText}}"/>
- </StackPanel>
- </Border>
- </Button.Content>
- </Button>
-
- <Button x:Name="EditButton"
- Click="EditButton_Click"
- IsEnabled="{Binding IsRunning, Converter={StaticResource Inverted}}"
- Padding="4"
- Grid.Row="1"
- BorderThickness="0"
- Background="Transparent"
- HorizontalAlignment="Stretch"
- HorizontalContentAlignment="Stretch">
- <Button.Content>
- <Border
- CornerRadius="5"
- Background="{Binding IsRunning, Converter={StaticResource InvertedColor}}"
- BorderBrush="Gray"
- BorderThickness="0.75"
- Padding="10"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
- <StackPanel
- Orientation="Vertical"
- VerticalAlignment="Center"
- HorizontalAlignment="Center" >
- <Image Source="../Resources/settings.png" Height="40" Width="40"/>
- <Label Content="Settings" />
- </StackPanel>
- </Border>
- </Button.Content>
- </Button>
-
- <Button x:Name="StartButton"
- Click="StartButton_Click"
- Padding="4"
- Grid.Row="2"
- BorderThickness="0"
- Background="Transparent"
- HorizontalAlignment="Stretch"
- HorizontalContentAlignment="Stretch"
- IsEnabled="{Binding IsInstalled}">
- <Button.Content>
- <Border
- CornerRadius="5"
- Background="{Binding IsInstalled, Converter={StaticResource NormalColor}}"
- BorderBrush="Gray"
- BorderThickness="0.75"
- Padding="10"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
- <StackPanel
- Orientation="Vertical"
- VerticalAlignment="Center"
- HorizontalAlignment="Center" >
- <Image Source="{Binding IsRunning, Converter={StaticResource RunningImage}}" Height="40" Width="40" />
- <Label Content="{Binding IsRunning, Converter={StaticResource RunningText}}"/>
- </StackPanel>
- </Border>
- </Button.Content>
-
- </Button>
-
- <Button x:Name="GenerateButton"
- Click="GenerateButton_Click"
- IsEnabled="{Binding HasDbServer}"
- Padding="4"
- Grid.Row="4"
- BorderThickness="0"
- Background="Transparent"
- HorizontalAlignment="Stretch"
- HorizontalContentAlignment="Stretch">
- <Button.Content>
- <Border
- CornerRadius="5"
- Background="{Binding HasDbServer, Converter={StaticResource NormalColor}}"
- BorderBrush="Gray"
- BorderThickness="0.75"
- Padding="10"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch">
- <StackPanel
- Orientation="Vertical"
- VerticalAlignment="Center"
- HorizontalAlignment="Center" >
- <Image Source="../Resources/generate.png" Height="40" Width="40"/>
- <Label Content="Generate" />
- </StackPanel>
- </Border>
- </Button.Content>
- </Button>
- </Grid>
- </Border>
- </dg:DynamicSplitPanel.Master>
- <dg:DynamicSplitPanel.DetailHeader>
- <Border BorderBrush="Gray" BorderThickness="0.75" Background="WhiteSmoke">
- <Label Content="Console" HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center" />
- </Border>
- </dg:DynamicSplitPanel.DetailHeader>
- <dg:DynamicSplitPanel.Detail>
- <console:ConsoleControl x:Name="ConsoleControl"
- Enabled="{Binding IsRunning}"
- Margin="-5,5,-5,0"
- AllowLoadLogButton="False"/>
- </dg:DynamicSplitPanel.Detail>
- </dg:DynamicSplitPanel>
- </Window>
|