|
1 |
| -<Window x:Class="GUIConsole.Wpf.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 |
| - mc:Ignorable="d" |
7 |
| - |
8 |
| - Title="MainWindow" Height="450" Width="800" |
9 |
| - Background="#C7000000" |
10 |
| - AllowsTransparency="True" |
11 |
| - WindowStyle="None" |
12 |
| - MouseDown="Window_MouseDown" |
13 |
| - BorderThickness="1" |
14 |
| - BorderBrush="LightSlateGray" |
15 |
| - |
16 |
| - KeyDown="Window_KeyDown" |
17 |
| - Loaded="Window_Loaded"> |
18 |
| - <Window.Resources> |
19 |
| - <Style x:Key="TitleBarButtonStyle" TargetType="{x:Type Button}"> |
20 |
| - <Setter Property="Background" Value="Transparent"/> |
21 |
| - <Setter Property="FontFamily" Value="Segoe MDL2 Assets"/> |
22 |
| - <Setter Property="FontSize" Value="14"/> |
23 |
| - <Setter Property="Height" Value="32"/> |
24 |
| - <Setter Property="Width" Value="46"/> |
25 |
| - <Setter Property="Background" Value="Transparent"/> |
26 |
| - <Setter Property="Foreground" Value="White"/> |
27 |
| - <Setter Property="BorderThickness" Value="0"/> |
28 |
| - </Style> |
29 |
| - |
30 |
| - <Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource TitleBarButtonStyle}"> |
31 |
| - <Setter Property="Content" Value=""/> |
32 |
| - <!--Remove the default Button template's Triggers, otherwise they'll override our trigger below.--> |
33 |
| - <Setter Property="Template"> |
34 |
| - <Setter.Value> |
35 |
| - <ControlTemplate TargetType="{x:Type Button}"> |
36 |
| - <Border Background="{TemplateBinding Background}"> |
37 |
| - <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/> |
38 |
| - </Border> |
39 |
| - </ControlTemplate> |
40 |
| - </Setter.Value> |
41 |
| - </Setter> |
42 |
| - <Style.Triggers> |
43 |
| - <Trigger Property="IsMouseOver" Value="True"> |
44 |
| - <Setter Property="Button.Background" Value="Red"/> |
45 |
| - </Trigger> |
46 |
| - </Style.Triggers> |
47 |
| - </Style> |
48 |
| - </Window.Resources> |
49 |
| - |
50 |
| - <Grid> |
51 |
| - <Grid.RowDefinitions> |
52 |
| - <RowDefinition Height="Auto"/> |
53 |
| - <RowDefinition Height="*"/> |
54 |
| - </Grid.RowDefinitions> |
55 |
| - |
56 |
| - <Grid Grid.Row="0"> |
57 |
| - <Grid.ColumnDefinitions> |
58 |
| - <ColumnDefinition Width="*"/> |
59 |
| - <ColumnDefinition Width="Auto"/> |
60 |
| - </Grid.ColumnDefinitions> |
61 |
| - <TextBlock x:Name="TitleBarTitle" Grid.Column="0" VerticalAlignment="Center" Padding="10 0" Foreground="White"> |
62 |
| - GUIConsole |
63 |
| - </TextBlock> |
64 |
| - <StackPanel x:Name="TitleBarButtons" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Top"> |
65 |
| - <Button x:Name="MinimizeButton" |
66 |
| - Click="MinimizeButton_Click" |
67 |
| - Content="" |
68 |
| - Style="{StaticResource TitleBarButtonStyle}"/> |
69 |
| - <Button x:Name="MaximizeRestoreButton" |
70 |
| - Click="MaximizeRestoreButton_Click" |
71 |
| - Content="" |
72 |
| - FontSize="12" |
73 |
| - Style="{StaticResource TitleBarButtonStyle}"/> |
74 |
| - <Button x:Name="CloseButton" |
75 |
| - Click="CloseButton_Click" |
76 |
| - FontSize="12" |
77 |
| - Style="{StaticResource CloseButtonStyle}"/> |
78 |
| - </StackPanel> |
79 |
| - </Grid> |
80 |
| - <ScrollViewer x:Name="TerminalHistoryViewer" Grid.Row="1" ScrollChanged="ScrollViewer_ScrollChanged"> |
81 |
| - <TextBlock x:Name="TerminalHistoryBlock" FontFamily="Consolas" TextWrapping="Wrap" Foreground="White"/> |
82 |
| - </ScrollViewer> |
83 |
| - </Grid> |
84 |
| -</Window> |
| 1 | +<Window x:Class="GUIConsole.Wpf.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 | + Title="MainWindow" |
| 7 | + Width="800" |
| 8 | + Height="450" |
| 9 | + AllowsTransparency="True" |
| 10 | + Background="#C7000000" |
| 11 | + BorderBrush="LightSlateGray" |
| 12 | + BorderThickness="1" |
| 13 | + KeyDown="Window_KeyDown" |
| 14 | + Loaded="Window_Loaded" |
| 15 | + MouseDown="Window_MouseDown" |
| 16 | + WindowStyle="None" |
| 17 | + mc:Ignorable="d"> |
| 18 | + <Window.Resources> |
| 19 | + <Style x:Key="TitleBarButtonStyle" |
| 20 | + TargetType="{x:Type Button}"> |
| 21 | + <Setter Property="Background" Value="Transparent" /> |
| 22 | + <Setter Property="FontFamily" Value="Segoe MDL2 Assets" /> |
| 23 | + <Setter Property="FontSize" Value="14" /> |
| 24 | + <Setter Property="Height" Value="32" /> |
| 25 | + <Setter Property="Width" Value="46" /> |
| 26 | + <Setter Property="Background" Value="Transparent" /> |
| 27 | + <Setter Property="Foreground" Value="White" /> |
| 28 | + <Setter Property="BorderThickness" Value="0" /> |
| 29 | + </Style> |
| 30 | + |
| 31 | + <Style x:Key="CloseButtonStyle" |
| 32 | + BasedOn="{StaticResource TitleBarButtonStyle}" |
| 33 | + TargetType="{x:Type Button}"> |
| 34 | + <Setter Property="Content" Value="" /> |
| 35 | + <!-- Remove the default Button template's Triggers, otherwise they'll override our trigger below. --> |
| 36 | + <Setter Property="Template"> |
| 37 | + <Setter.Value> |
| 38 | + <ControlTemplate TargetType="{x:Type Button}"> |
| 39 | + <Border Background="{TemplateBinding Background}"> |
| 40 | + <ContentPresenter HorizontalAlignment="Center" |
| 41 | + VerticalAlignment="Center" /> |
| 42 | + </Border> |
| 43 | + </ControlTemplate> |
| 44 | + </Setter.Value> |
| 45 | + </Setter> |
| 46 | + <Style.Triggers> |
| 47 | + <Trigger Property="IsMouseOver" Value="True"> |
| 48 | + <Setter Property="Button.Background" Value="Red" /> |
| 49 | + </Trigger> |
| 50 | + </Style.Triggers> |
| 51 | + </Style> |
| 52 | + </Window.Resources> |
| 53 | + |
| 54 | + <Grid> |
| 55 | + <Grid.RowDefinitions> |
| 56 | + <RowDefinition Height="Auto" /> |
| 57 | + <RowDefinition Height="*" /> |
| 58 | + </Grid.RowDefinitions> |
| 59 | + |
| 60 | + <Grid Grid.Row="0"> |
| 61 | + <Grid.ColumnDefinitions> |
| 62 | + <ColumnDefinition Width="*" /> |
| 63 | + <ColumnDefinition Width="Auto" /> |
| 64 | + </Grid.ColumnDefinitions> |
| 65 | + <TextBlock x:Name="TitleBarTitle" |
| 66 | + Grid.Column="0" |
| 67 | + Padding="10,0" |
| 68 | + VerticalAlignment="Center" |
| 69 | + Foreground="White"> |
| 70 | + GUIConsole |
| 71 | + </TextBlock> |
| 72 | + <StackPanel x:Name="TitleBarButtons" |
| 73 | + Grid.Column="1" |
| 74 | + VerticalAlignment="Top" |
| 75 | + Orientation="Horizontal"> |
| 76 | + <Button x:Name="MinimizeButton" |
| 77 | + Click="MinimizeButton_Click" |
| 78 | + Content="" |
| 79 | + Style="{StaticResource TitleBarButtonStyle}" /> |
| 80 | + <Button x:Name="MaximizeRestoreButton" |
| 81 | + Click="MaximizeRestoreButton_Click" |
| 82 | + Content="" |
| 83 | + FontSize="12" |
| 84 | + Style="{StaticResource TitleBarButtonStyle}" /> |
| 85 | + <Button x:Name="CloseButton" |
| 86 | + Click="CloseButton_Click" |
| 87 | + FontSize="12" |
| 88 | + Style="{StaticResource CloseButtonStyle}" /> |
| 89 | + </StackPanel> |
| 90 | + </Grid> |
| 91 | + <ScrollViewer x:Name="TerminalHistoryViewer" |
| 92 | + Grid.Row="1" |
| 93 | + ScrollChanged="ScrollViewer_ScrollChanged"> |
| 94 | + <TextBlock x:Name="TerminalHistoryBlock" |
| 95 | + FontFamily="Consolas" |
| 96 | + Foreground="White" |
| 97 | + TextWrapping="Wrap" /> |
| 98 | + </ScrollViewer> |
| 99 | + </Grid> |
| 100 | +</Window> |
0 commit comments