GUI/ScriptPad.xaml

<Controls:MetroWindow
    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:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
    xmlns:Controls = "clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
 
    Title = "ScriptPad"
    Width = "800"
    Height = "500"
    Background = "#F7FAFC"
    BorderBrush = "{DynamicResource MahApps.Brushes.Accent}"
    BorderThickness = "0"
 
    GlowBrush = "Black"
    NonActiveGlowBrush = "Black"
    OverrideDefaultWindowCommandsBrush = "Black"
    ResizeMode = "CanResizeWithGrip"
    TitleForeground = "Black"
    WindowStartupLocation = "CenterScreen"
    WindowTitleBrush = "#F7FAFC"
    NonActiveWindowTitleBrush = "#F7FAFC"
    WindowTransitionsEnabled = "False">
 
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
                <!-- Accent and AppTheme setting -->
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
            </ResourceDictionary.MergedDictionaries>
 
            <Style TargetType="{x:Type Window}">
                <Setter Property="FontFamily" Value="Segoe UI" />
                <Setter Property="FontWeight" Value="Light" />
                <Setter Property="Background" Value="#1F1F1F" />
                <Setter Property="Foreground" Value="Black" />
            </Style>
 
            <Style TargetType="{x:Type Button}">
                <Setter Property="Background" Value="{DynamicResource FlatButtonBackgroundBrush}" />
                <Setter Property="BorderThickness" Value="0" />
                <Setter Property="FontSize" Value="{DynamicResource FlatButtonFontSize}" />
                <Setter Property="Foreground" Value="{DynamicResource FlatButtonForegroundBrush}" />
                <Setter Property="Padding" Value="10 5 10 5" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}" xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro">
                            <Border x:Name="Border"
                                Margin="0"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                CornerRadius = "5"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                <Controls:ContentControlEx x:Name="PART_ContentPresenter"
                                    Padding="{TemplateBinding Padding}"
                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                    Content="{TemplateBinding Content}"
                                    ContentCharacterCasing="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.ContentCharacterCasing)}"
                                    ContentStringFormat="{TemplateBinding ContentStringFormat}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                    RecognizesAccessKey="True"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <!-- Windows 11 Theme Dark Blue -->
                        <Setter Property="Background" Value="#003E92" />
                    </Trigger>
                    <Trigger Property="IsMouseOver" Value="False">
                        <!-- Windows 11 Theme Blue -->
                        <Setter Property="Background" Value="#0067C0" />
                    </Trigger>
                    <Trigger Property="IsPressed" Value="True">
                        <Setter Property="Background" Value="{DynamicResource FlatButtonPressedBackgroundBrush}" />
                        <Setter Property="Foreground" Value="{DynamicResource FlatButtonPressedForegroundBrush}" />
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Foreground" Value="{DynamicResource GrayBrush2}" />
                    </Trigger>
                </Style.Triggers>
            </Style>
            <Style TargetType="{x:Type Label}">
                <Setter Property = "FontFamily" Value = "Segoe UI" />
            </Style>
 
            <Style TargetType="{x:Type TextBox}">
                <Setter Property = "FontFamily" Value = "Segoe UI" />
            </Style>
 
            <Style TargetType="{x:Type ComboBox}">
                <Setter Property = "FontFamily" Value = "Segoe UI" />
            </Style>
        </ResourceDictionary>
    </Window.Resources>
 
    <Grid>
        <Grid.Background>
            <LinearGradientBrush StartPoint = "0,0" EndPoint = "1,1">
            <GradientStop Color = "White" Offset = "0.0" />
            <GradientStop Color = "#EDF1FA" Offset = "0.3" />
            <GradientStop Color = "#EDF3FE" Offset = "0.7" />
            <GradientStop Color = "#F7FAFC" Offset = "1.0" />
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="300"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="20"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="10"/>
            <RowDefinition Height="70"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="60"/>
            <RowDefinition Height="10"/>
        </Grid.RowDefinitions>
 
        <!-- Script Combo -->
        <StackPanel
            Grid.Column = "1"
            Grid.ColumnSpan = "2"
            Grid.Row = "1"
            HorizontalAlignment = "Left">
            <ComboBox
                Name = "ComboBoxScriptPadName"
                Background = "LightBlue"
                FontSize = "16"
                Height = "30"
                HorizontalAlignment = "Left"
                SelectedIndex = "0"
                VerticalAlignment = "Top"
                Width = "500" />
            <Label
                Name = "LabelScriptPadDescription"
                Content = ""
                FontSize = "14"
                Foreground = "Black"
                VerticalAlignment = "Center"/>
        </StackPanel>
     
        <!-- Script TextBox -->
        <TextBox
            Grid.Column="1"
            Grid.ColumnSpan = "2"
            Grid.Row = "2"
            Name = "TextBoxScriptPadContent"
            Text = ""
            AcceptsReturn = "True"
            AcceptsTab = "True"
            Background = "Gainsboro"
            FontFamily = "Consolas"
            FontSize = "14"
            Foreground = "Black"
            HorizontalAlignment = "Stretch"
            ScrollViewer.HorizontalScrollBarVisibility = "Visible"
            ScrollViewer.VerticalScrollBarVisibility = "Visible"
            VerticalAlignment = "Stretch" />
 
        <!-- Title -->
        <StackPanel
            Grid.Column = "1"
            Grid.ColumnSpan = "2"
            Grid.Row = "3"
            HorizontalAlignment = "Left"
            VerticalAlignment = "Center">
            <Label
                Name = "LabelTitle"
                Content = ""
                FontSize = "26"
                Foreground = "#003E92" />
        </StackPanel>
 
        <!-- Button -->
        <StackPanel
            Grid.Column = "2"
            Grid.ColumnSpan = "1"
            Grid.Row = "3"
            HorizontalAlignment = "Right"
            VerticalAlignment = "Center">
            <Button
                Name = "GoButton"
                Content = "Invoke-Command"
                FontSize = "14"
                Foreground = "White"
                Height = "40"
                Width = "130" />
        </StackPanel>
    </Grid>
</Controls:MetroWindow>