Advertisement
Krythic

Example

May 31st, 2021
1,211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 40.13 KB | None | 0 0
  1. <UserControl
  2.     x:Class="VoidwalkerEngine.Editor.Controls.Modules.VoidwalkerConsoleModule"
  3.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5.     xmlns:controls="clr-namespace:VoidwalkerEngine.Editor.Controls"
  6.     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7.     xmlns:local="clr-namespace:VoidwalkerEngine.Editor.Controls.Modules"
  8.     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9.     d:DesignHeight="450"
  10.     d:DesignWidth="800"
  11.     mc:Ignorable="d">
  12.     <Grid>
  13.         <Grid.RowDefinitions>
  14.             <RowDefinition Height="4" />
  15.             <RowDefinition Height="28" />
  16.             <RowDefinition />
  17.             <RowDefinition Height="2" />
  18.             <RowDefinition Height="28" />
  19.         </Grid.RowDefinitions>
  20.         <Grid.ColumnDefinitions>
  21.             <ColumnDefinition Width="3" />
  22.             <ColumnDefinition />
  23.             <ColumnDefinition Width="3" />
  24.         </Grid.ColumnDefinitions>
  25.  
  26.         <Grid Grid.Row="1" Grid.Column="1">
  27.             <Grid.ColumnDefinitions>
  28.                 <ColumnDefinition Width="100" />
  29.                 <ColumnDefinition Width="4" />
  30.                 <ColumnDefinition />
  31.             </Grid.ColumnDefinitions>
  32.             <Grid.RowDefinitions>
  33.                 <RowDefinition Height="24" />
  34.             </Grid.RowDefinitions>
  35.  
  36.             <!--  Filter Drop Down Menu  -->
  37.             <ComboBox>
  38.                 <ComboBox.Resources>
  39.                     <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
  40.                         <Grid>
  41.                             <Grid.ColumnDefinitions>
  42.                                 <ColumnDefinition Width="32*" />
  43.                                 <ColumnDefinition Width="Auto" />
  44.                                 <ColumnDefinition Width="4" />
  45.                                 <ColumnDefinition Width="Auto" />
  46.                                 <ColumnDefinition Width="29*" />
  47.                             </Grid.ColumnDefinitions>
  48.                             <Border
  49.                                 x:Name="Border"
  50.                                 Grid.Column="0"
  51.                                 Grid.ColumnSpan="5"
  52.                                 Background="Transparent"
  53.                                 BorderBrush="Transparent"
  54.                                 BorderThickness="1"
  55.                                 CornerRadius="2" />
  56.                             <Border
  57.                                 Grid.Column="1"
  58.                                 Margin="1"
  59.                                 Background="Transparent"
  60.                                 CornerRadius="2,0,0,2" />
  61.                             <Label
  62.                                 Grid.Column="1"
  63.                                 Margin="0"
  64.                                 Padding="0"
  65.                                 VerticalAlignment="Center"
  66.                                 Content="Filters"
  67.                                 FontFamily="/Voidwalker Engine Editor;component/Editor/Resources/Fonts/#Roboto Medium"
  68.                                 FontSize="11"
  69.                                 Foreground="#e6e6e6" />
  70.                             <Image
  71.                                 Grid.Column="3"
  72.                                 Width="10"
  73.                                 Height="6"
  74.                                 HorizontalAlignment="Left"
  75.                                 RenderOptions.BitmapScalingMode="NearestNeighbor"
  76.                                 Source="/Voidwalker Engine Editor;component/Editor/Resources/Graphics/Editor/SpinnerDownArrow.png" />
  77.                         </Grid>
  78.                         <ControlTemplate.Triggers>
  79.                             <Trigger Property="IsMouseOver" Value="True">
  80.                                 <Setter TargetName="Border" Property="Background" Value="#007acc" />
  81.                             </Trigger>
  82.                             <Trigger Property="IsChecked" Value="True">
  83.                                 <Setter TargetName="Border" Property="Background" Value="#3ea6ff" />
  84.                             </Trigger>
  85.                         </ControlTemplate.Triggers>
  86.                     </ControlTemplate>
  87.  
  88.                     <ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}">
  89.                         <Border
  90.                             x:Name="PART_ContentHost"
  91.                             Background="{TemplateBinding Background}"
  92.                             Focusable="False" />
  93.                     </ControlTemplate>
  94.  
  95.  
  96.                     <ControlTemplate x:Key="FilterDropDownOptionToggleButtonStyle" TargetType="{x:Type ToggleButton}">
  97.                         <Border x:Name="OuterBorder" IsHitTestVisible="True">
  98.                             <Grid>
  99.                                 <Grid.ColumnDefinitions>
  100.                                     <ColumnDefinition Width="15" />
  101.                                     <ColumnDefinition Width="Auto" />
  102.                                     <ColumnDefinition Width="15" />
  103.                                     <ColumnDefinition />
  104.                                     <ColumnDefinition Width="24" />
  105.                                 </Grid.ColumnDefinitions>
  106.                                 <Image
  107.                                     x:Name="Checkmark"
  108.                                     Grid.Column="1"
  109.                                     Width="16"
  110.                                     Height="12"
  111.                                     HorizontalAlignment="Right"
  112.                                     RenderOptions.BitmapScalingMode="NearestNeighbor"
  113.                                     Source="/Voidwalker Engine Editor;component/Editor/Resources/Graphics/Editor/Checkmark.png" />
  114.                                 <Label
  115.                                     Grid.Column="3"
  116.                                     Padding="0"
  117.                                     HorizontalAlignment="Left"
  118.                                     VerticalAlignment="Center"
  119.                                     Content="{TemplateBinding Content}"
  120.                                     Foreground="{DynamicResource LightForeground1SolidColorBrush}" />
  121.                             </Grid>
  122.                         </Border>
  123.  
  124.                         <!--  Here  -->
  125.  
  126.                         <ControlTemplate.Triggers>
  127.                             <Trigger Property="IsMouseOver" Value="True">
  128.                                 <Setter TargetName="OuterBorder" Property="Background" Value="#4c4c4c" />
  129.                             </Trigger>
  130.                             <Trigger Property="IsMouseOver" Value="False">
  131.                                 <Setter TargetName="OuterBorder" Property="Background" Value="Transparent" />
  132.                             </Trigger>
  133.  
  134.                             <Trigger Property="ToggleButton.IsChecked" Value="False">
  135.                                 <Setter TargetName="Checkmark" Property="Visibility" Value="Hidden" />
  136.                             </Trigger>
  137.                             <Trigger Property="ToggleButton.IsChecked" Value="True">
  138.                                 <Setter TargetName="Checkmark" Property="Visibility" Value="Visible" />
  139.                             </Trigger>
  140.                         </ControlTemplate.Triggers>
  141.                     </ControlTemplate>
  142.  
  143.  
  144.  
  145.  
  146.                     <Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
  147.                         <Setter Property="SnapsToDevicePixels" Value="true" />
  148.                         <Setter Property="OverridesDefaultStyle" Value="true" />
  149.                         <Setter Property="Template">
  150.                             <Setter.Value>
  151.                                 <ControlTemplate TargetType="{x:Type ComboBoxItem}">
  152.                                     <Border
  153.                                         x:Name="Border"
  154.                                         Padding="2"
  155.                                         Background="Transparent"
  156.                                         SnapsToDevicePixels="true">
  157.                                         <ContentPresenter />
  158.                                         <VisualStateManager.VisualStateGroups>
  159.                                             <VisualStateGroup x:Name="SelectionStates">
  160.                                                 <VisualState x:Name="Unselected" />
  161.                                                 <VisualState x:Name="Selected">
  162.                                                     <Storyboard>
  163.                                                         <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Panel.Background).                     (SolidColorBrush.Color)">
  164.                                                             <EasingColorKeyFrame KeyTime="0" Value="Blue" />
  165.                                                         </ColorAnimationUsingKeyFrames>
  166.                                                     </Storyboard>
  167.                                                 </VisualState>
  168.                                                 <VisualState x:Name="SelectedUnfocused">
  169.                                                     <Storyboard>
  170.                                                         <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border" Storyboard.TargetProperty="(Panel.Background).                     (SolidColorBrush.Color)">
  171.                                                             <EasingColorKeyFrame KeyTime="0" Value="Purple" />
  172.                                                         </ColorAnimationUsingKeyFrames>
  173.                                                     </Storyboard>
  174.                                                 </VisualState>
  175.                                             </VisualStateGroup>
  176.                                         </VisualStateManager.VisualStateGroups>
  177.                                     </Border>
  178.                                 </ControlTemplate>
  179.                             </Setter.Value>
  180.                         </Setter>
  181.                     </Style>
  182.  
  183.                 </ComboBox.Resources>
  184.                 <ComboBox.Style>
  185.                     <Style TargetType="{x:Type ComboBox}">
  186.                         <Setter Property="SnapsToDevicePixels" Value="true" />
  187.                         <Setter Property="OverridesDefaultStyle" Value="true" />
  188.                         <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
  189.                         <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
  190.                         <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
  191.                         <Setter Property="MinWidth" Value="25" />
  192.                         <Setter Property="MinHeight" Value="20" />
  193.  
  194.                         <Setter Property="Template">
  195.                             <Setter.Value>
  196.                                 <ControlTemplate TargetType="{x:Type ComboBox}">
  197.                                     <Grid>
  198.                                         <ToggleButton
  199.                                             x:Name="ToggleButton"
  200.                                             Grid.Column="2"
  201.                                             ClickMode="Press"
  202.                                             Focusable="false"
  203.                                             IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  204.                                             Template="{StaticResource ComboBoxToggleButton}" />
  205.                                         <ContentPresenter
  206.                                             x:Name="ContentSite"
  207.                                             Margin="3,3,23,3"
  208.                                             HorizontalAlignment="Left"
  209.                                             VerticalAlignment="Stretch"
  210.                                             Content="{TemplateBinding SelectionBoxItem}"
  211.                                             ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
  212.                                             ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
  213.                                             IsHitTestVisible="False" />
  214.                                         <TextBox
  215.                                             x:Name="PART_EditableTextBox"
  216.                                             Margin="3,3,23,3"
  217.                                             HorizontalAlignment="Left"
  218.                                             VerticalAlignment="Bottom"
  219.                                             Background="Transparent"
  220.                                             Focusable="True"
  221.                                             IsReadOnly="{TemplateBinding IsReadOnly}"
  222.                                             Style="{x:Null}"
  223.                                             Template="{StaticResource ComboBoxTextBox}"
  224.                                             Visibility="Hidden" />
  225.                                         <Popup
  226.                                             x:Name="Popup"
  227.                                             AllowsTransparency="True"
  228.                                             Focusable="False"
  229.                                             IsOpen="{TemplateBinding IsDropDownOpen}"
  230.                                             Placement="Bottom"
  231.                                             PopupAnimation="Slide">
  232.                                             <Grid
  233.                                                 x:Name="DropDown"
  234.                                                 Width="Auto"
  235.                                                 MaxHeight="{TemplateBinding MaxDropDownHeight}"
  236.                                                 SnapsToDevicePixels="True">
  237.                                                 <Border
  238.                                                     x:Name="DropDownBorder"
  239.                                                     Background="#383838"
  240.                                                     BorderBrush="#4c4c4c"
  241.                                                     BorderThickness="1">
  242.                                                     <Grid>
  243.                                                         <Grid.ColumnDefinitions>
  244.                                                             <ColumnDefinition Width="4" />
  245.                                                             <ColumnDefinition />
  246.                                                             <ColumnDefinition Width="4" />
  247.                                                         </Grid.ColumnDefinitions>
  248.                                                         <Grid.RowDefinitions>
  249.                                                             <RowDefinition Height="4" />
  250.                                                             <RowDefinition Height="24" />
  251.                                                             <RowDefinition Height="24" />
  252.                                                             <RowDefinition Height="24" />
  253.                                                             <RowDefinition Height="24" />
  254.                                                             <RowDefinition Height="24" />
  255.                                                             <RowDefinition Height="4" />
  256.                                                         </Grid.RowDefinitions>
  257.  
  258.                                                         <ToggleButton
  259.                                                             Grid.Row="1"
  260.                                                             Grid.Column="1"
  261.                                                             IsChecked="True"
  262.                                                             Template="{DynamicResource FilterDropDownOptionToggleButtonStyle}">
  263.                                                             Messages
  264.                                                         </ToggleButton>
  265.                                                         <ToggleButton
  266.                                                             Grid.Row="2"
  267.                                                             Grid.Column="1"
  268.                                                             IsChecked="True"
  269.                                                             Template="{DynamicResource FilterDropDownOptionToggleButtonStyle}">
  270.                                                             Warnings
  271.                                                         </ToggleButton>
  272.                                                         <ToggleButton
  273.                                                             Grid.Row="3"
  274.                                                             Grid.Column="1"
  275.                                                             IsChecked="True"
  276.                                                             Template="{DynamicResource FilterDropDownOptionToggleButtonStyle}">
  277.                                                             Errors
  278.                                                         </ToggleButton>
  279.                                                         <ToggleButton
  280.                                                             Grid.Row="4"
  281.                                                             Grid.Column="1"
  282.                                                             IsChecked="True"
  283.                                                             Template="{DynamicResource FilterDropDownOptionToggleButtonStyle}">
  284.                                                             Engine Debugging
  285.                                                         </ToggleButton>
  286.                                                         <ToggleButton
  287.                                                             Grid.Row="5"
  288.                                                             Grid.Column="1"
  289.                                                             IsChecked="True"
  290.                                                             Template="{DynamicResource FilterDropDownOptionToggleButtonStyle}">
  291.                                                             User Commands
  292.                                                         </ToggleButton>
  293.                                                     </Grid>
  294.                                                 </Border>
  295.                                             </Grid>
  296.                                         </Popup>
  297.                                     </Grid>
  298.                                     <ControlTemplate.Triggers>
  299.                                         <Trigger Property="HasItems" Value="false">
  300.                                             <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95" />
  301.                                         </Trigger>
  302.                                         <Trigger Property="IsGrouping" Value="true">
  303.                                             <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
  304.                                         </Trigger>
  305.                                         <Trigger SourceName="Popup" Property="AllowsTransparency" Value="true">
  306.                                             <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4" />
  307.                                             <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0" />
  308.                                         </Trigger>
  309.                                     </ControlTemplate.Triggers>
  310.                                 </ControlTemplate>
  311.                             </Setter.Value>
  312.                         </Setter>
  313.                     </Style>
  314.                 </ComboBox.Style>
  315.  
  316.  
  317.  
  318.             </ComboBox>
  319.             <!--  Filter Drop Down Menu  -->
  320.  
  321.             <controls:SearchTextBox Grid.Column="2" />
  322.         </Grid>
  323.  
  324.         <Border
  325.             Grid.Row="2"
  326.             Grid.Column="1"
  327.             Background="#0f0f0f"
  328.             BorderThickness="0"
  329.             CornerRadius="4">
  330.             <ScrollViewer>
  331.                 <ScrollViewer.Resources>
  332.                     <!--
  333.                         Define The VerticalScrollBar Thumb Style
  334.                     -->
  335.                     <Style x:Key="VerticalScrollBarThumbStyle" TargetType="{x:Type Thumb}">
  336.                         <Setter Property="IsTabStop" Value="False" />
  337.                         <Setter Property="Focusable" Value="False" />
  338.                         <Setter Property="Margin" Value="1,0,1,0" />
  339.                         <Setter Property="Template">
  340.                             <Setter.Value>
  341.                                 <ControlTemplate TargetType="{x:Type Thumb}">
  342.                                     <Rectangle
  343.                                         Name="ellipse"
  344.                                         Width="10"
  345.                                         Fill="#575757"
  346.                                         RadiusX="5"
  347.                                         RadiusY="5"
  348.                                         Stroke="Transparent" />
  349.                                     <ControlTemplate.Triggers>
  350.                                         <Trigger Property="IsMouseOver" Value="true">
  351.                                             <Setter TargetName="ellipse" Property="Fill" Value="#808080" />
  352.                                         </Trigger>
  353.                                         <Trigger Property="IsDragging" Value="True">
  354.                                             <Setter TargetName="ellipse" Property="Fill" Value="#808080" />
  355.                                         </Trigger>
  356.  
  357.                                     </ControlTemplate.Triggers>
  358.                                 </ControlTemplate>
  359.                             </Setter.Value>
  360.                         </Setter>
  361.                     </Style>
  362.  
  363.                     <!--
  364.                         Define The HorizontalScrollBar Thumb Style
  365.                     -->
  366.                     <Style x:Key="HorizontalScrollBarThumbStyle" TargetType="{x:Type Thumb}">
  367.                         <Setter Property="IsTabStop" Value="False" />
  368.                         <Setter Property="Focusable" Value="False" />
  369.                         <Setter Property="Margin" Value="0,1,0,1" />
  370.                         <Setter Property="Template">
  371.                             <Setter.Value>
  372.                                 <ControlTemplate TargetType="{x:Type Thumb}">
  373.                                     <Rectangle
  374.                                         Name="ellipse"
  375.                                         Height="10"
  376.                                         Fill="#575757"
  377.                                         RadiusX="5"
  378.                                         RadiusY="5"
  379.                                         Stroke="Transparent" />
  380.                                     <ControlTemplate.Triggers>
  381.                                         <Trigger Property="IsMouseOver" Value="true">
  382.                                             <Setter TargetName="ellipse" Property="Fill" Value="#808080" />
  383.                                         </Trigger>
  384.                                         <Trigger Property="IsDragging" Value="True">
  385.                                             <Setter TargetName="ellipse" Property="Fill" Value="#808080" />
  386.                                         </Trigger>
  387.                                     </ControlTemplate.Triggers>
  388.                                 </ControlTemplate>
  389.                             </Setter.Value>
  390.                         </Setter>
  391.                     </Style>
  392.  
  393.                     <!--
  394.                         Define The Button Up Style
  395.                     -->
  396.                     <Style x:Key="ButtonUpStyle" TargetType="{x:Type RepeatButton}">
  397.                         <Setter Property="Focusable" Value="False" />
  398.                         <Setter Property="Template">
  399.                             <Setter.Value>
  400.                                 <ControlTemplate TargetType="{x:Type RepeatButton}">
  401.                                     <Grid Height="18" Margin="1">
  402.                                         <Path
  403.                                             Name="Path"
  404.                                             HorizontalAlignment="Center"
  405.                                             VerticalAlignment="Center"
  406.                                             Data="M 0 8 L 8 8 L 4 0 Z"
  407.                                             Fill="{DynamicResource GlobalAccentSolidColorBrush}"
  408.                                             Stretch="None" />
  409.                                     </Grid>
  410.                                     <ControlTemplate.Triggers>
  411.                                         <Trigger Property="IsMouseOver" Value="true">
  412.                                             <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
  413.                                         </Trigger>
  414.                                         <Trigger Property="IsPressed" Value="true">
  415.                                             <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
  416.                                         </Trigger>
  417.                                     </ControlTemplate.Triggers>
  418.                                 </ControlTemplate>
  419.                             </Setter.Value>
  420.                         </Setter>
  421.                     </Style>
  422.  
  423.                     <!--
  424.                         Define The Button Down Style
  425.                     -->
  426.                     <Style x:Key="ButtonDownStyle" TargetType="{x:Type RepeatButton}">
  427.                         <Setter Property="Focusable" Value="False" />
  428.                         <Setter Property="Template">
  429.                             <Setter.Value>
  430.                                 <ControlTemplate TargetType="{x:Type RepeatButton}">
  431.                                     <Grid Height="18" Margin="1">
  432.                                         <Path
  433.                                             Name="Path"
  434.                                             HorizontalAlignment="Center"
  435.                                             VerticalAlignment="Center"
  436.                                             Data="M 0 0 L 4 8 L 8 0 Z"
  437.                                             Fill="{DynamicResource GlobalAccentSolidColorBrush}"
  438.                                             Stretch="None" />
  439.                                     </Grid>
  440.                                     <ControlTemplate.Triggers>
  441.                                         <Trigger Property="IsMouseOver" Value="true">
  442.                                             <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
  443.                                         </Trigger>
  444.                                         <Trigger Property="IsPressed" Value="true">
  445.                                             <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
  446.                                         </Trigger>
  447.                                     </ControlTemplate.Triggers>
  448.                                 </ControlTemplate>
  449.                             </Setter.Value>
  450.                         </Setter>
  451.                     </Style>
  452.  
  453.                     <!--
  454.                         Define The Button Left Style
  455.                     -->
  456.                     <Style x:Key="ButtonLeftStyle" TargetType="{x:Type RepeatButton}">
  457.                         <Setter Property="Focusable" Value="False" />
  458.                         <Setter Property="Template">
  459.                             <Setter.Value>
  460.                                 <ControlTemplate TargetType="{x:Type RepeatButton}">
  461.                                     <Grid Width="18" Margin="1">
  462.                                         <Path
  463.                                             Name="Path"
  464.                                             HorizontalAlignment="Center"
  465.                                             VerticalAlignment="Center"
  466.                                             Data="M 0 0 L -8 4 L 0 8 Z"
  467.                                             Fill="{DynamicResource GlobalAccentSolidColorBrush}"
  468.                                             Stretch="None" />
  469.                                     </Grid>
  470.                                     <ControlTemplate.Triggers>
  471.                                         <Trigger Property="IsMouseOver" Value="true">
  472.                                             <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
  473.                                         </Trigger>
  474.                                         <Trigger Property="IsPressed" Value="true">
  475.                                             <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
  476.                                         </Trigger>
  477.                                     </ControlTemplate.Triggers>
  478.                                 </ControlTemplate>
  479.                             </Setter.Value>
  480.                         </Setter>
  481.                     </Style>
  482.  
  483.                     <!--
  484.                         Define The Button Right Style
  485.                     -->
  486.                     <Style x:Key="ButtonRightStyle" TargetType="{x:Type RepeatButton}">
  487.                         <Setter Property="Focusable" Value="False" />
  488.                         <Setter Property="Template">
  489.                             <Setter.Value>
  490.                                 <ControlTemplate TargetType="{x:Type RepeatButton}">
  491.                                     <Grid Width="18" Margin="1">
  492.                                         <Path
  493.                                             Name="Path"
  494.                                             HorizontalAlignment="Center"
  495.                                             VerticalAlignment="Center"
  496.                                             Data="M 0 0 L 8 4 L 0 8 Z"
  497.                                             Fill="{DynamicResource GlobalAccentSolidColorBrush}"
  498.                                             Stretch="None" />
  499.                                     </Grid>
  500.                                     <ControlTemplate.Triggers>
  501.                                         <Trigger Property="IsMouseOver" Value="true">
  502.                                             <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
  503.                                         </Trigger>
  504.                                         <Trigger Property="IsPressed" Value="true">
  505.                                             <Setter TargetName="Path" Property="Fill" Value="{DynamicResource GlobalAccentFeedbackSolidColorBrush}" />
  506.                                         </Trigger>
  507.                                     </ControlTemplate.Triggers>
  508.                                 </ControlTemplate>
  509.                             </Setter.Value>
  510.                         </Setter>
  511.                     </Style>
  512.  
  513.  
  514.                     <!--
  515.                         Define The ScrollBarPageButton Style
  516.                     -->
  517.                     <Style x:Key="ScrollBarPageButtonStyle" TargetType="{x:Type RepeatButton}">
  518.                         <Setter Property="IsTabStop" Value="False" />
  519.                         <Setter Property="Focusable" Value="False" />
  520.                         <Setter Property="Template">
  521.                             <Setter.Value>
  522.                                 <ControlTemplate TargetType="{x:Type RepeatButton}">
  523.                                     <Border Background="Transparent" />
  524.                                 </ControlTemplate>
  525.                             </Setter.Value>
  526.                         </Setter>
  527.                     </Style>
  528.  
  529.                     <!--
  530.                         Override The VerticalScrollBar Template
  531.                     -->
  532.                     <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
  533.                         <Grid>
  534.                             <Grid.RowDefinitions>
  535.                                 <RowDefinition MaxHeight="0" />
  536.                                 <RowDefinition Height="*" />
  537.                                 <RowDefinition MaxHeight="0" />
  538.                             </Grid.RowDefinitions>
  539.                             <Grid.Background>
  540.                                 <SolidColorBrush Color="#0f0f0f" />
  541.                             </Grid.Background>
  542.  
  543.                             <Track
  544.                                 Name="PART_Track"
  545.                                 Grid.Row="1"
  546.                                 IsDirectionReversed="True">
  547.                                 <Track.DecreaseRepeatButton>
  548.                                     <RepeatButton Command="ScrollBar.PageUpCommand" Style="{StaticResource ScrollBarPageButtonStyle}" />
  549.                                 </Track.DecreaseRepeatButton>
  550.                                 <Track.Thumb>
  551.                                     <Thumb Style="{StaticResource VerticalScrollBarThumbStyle}" />
  552.                                 </Track.Thumb>
  553.                                 <Track.IncreaseRepeatButton>
  554.                                     <RepeatButton Command="ScrollBar.PageDownCommand" Style="{StaticResource ScrollBarPageButtonStyle}" />
  555.                                 </Track.IncreaseRepeatButton>
  556.                             </Track>
  557.  
  558.                         </Grid>
  559.                     </ControlTemplate>
  560.  
  561.                     <!--
  562.                         Override The HorizontalScrollBar Template
  563.                     -->
  564.                     <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
  565.                         <Grid>
  566.                             <Grid.ColumnDefinitions>
  567.                                 <ColumnDefinition MaxWidth="0" />
  568.                                 <ColumnDefinition Width="*" />
  569.                                 <ColumnDefinition MaxWidth="0" />
  570.                             </Grid.ColumnDefinitions>
  571.                             <Grid.Background>
  572.                                 <SolidColorBrush Color="{TemplateBinding Background}" />
  573.                             </Grid.Background>
  574.  
  575.                             <Track
  576.                                 Name="PART_Track"
  577.                                 Grid.Column="1"
  578.                                 IsDirectionReversed="False">
  579.                                 <Track.DecreaseRepeatButton>
  580.                                     <RepeatButton Command="ScrollBar.PageLeftCommand" Style="{StaticResource ScrollBarPageButtonStyle}" />
  581.                                 </Track.DecreaseRepeatButton>
  582.                                 <Track.Thumb>
  583.                                     <Thumb Style="{StaticResource HorizontalScrollBarThumbStyle}" />
  584.                                 </Track.Thumb>
  585.                                 <Track.IncreaseRepeatButton>
  586.                                     <RepeatButton Command="ScrollBar.PageRightCommand" Style="{StaticResource ScrollBarPageButtonStyle}" />
  587.                                 </Track.IncreaseRepeatButton>
  588.                             </Track>
  589.                         </Grid>
  590.                     </ControlTemplate>
  591.  
  592.                     <!--
  593.                         Define The ScrollBar Style
  594.                     -->
  595.                     <Style TargetType="{x:Type ScrollBar}">
  596.                         <Setter Property="SnapsToDevicePixels" Value="True" />
  597.                         <Setter Property="OverridesDefaultStyle" Value="true" />
  598.                         <Style.Triggers>
  599.                             <Trigger Property="Orientation" Value="Vertical">
  600.                                 <Setter Property="Width" Value="18" />
  601.                                 <Setter Property="Height" Value="Auto" />
  602.                                 <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
  603.                             </Trigger>
  604.                             <Trigger Property="Orientation" Value="Horizontal">
  605.                                 <Setter Property="Width" Value="Auto" />
  606.                                 <Setter Property="Height" Value="18" />
  607.                                 <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
  608.                             </Trigger>
  609.                         </Style.Triggers>
  610.                     </Style>
  611.  
  612.                     <!--
  613.                         Define The ScrollViewer Style
  614.                     -->
  615.                     <Style TargetType="{x:Type ScrollViewer}">
  616.                         <Setter Property="Template">
  617.                             <Setter.Value>
  618.                                 <ControlTemplate TargetType="{x:Type ScrollViewer}">
  619.                                     <Grid>
  620.                                         <Grid.ColumnDefinitions>
  621.                                             <ColumnDefinition />
  622.                                             <ColumnDefinition Width="Auto" />
  623.                                         </Grid.ColumnDefinitions>
  624.                                         <Grid.RowDefinitions>
  625.                                             <RowDefinition />
  626.                                             <RowDefinition Height="Auto" />
  627.                                         </Grid.RowDefinitions>
  628.                                         <ScrollContentPresenter Grid.Column="0" />
  629.                                         <ScrollBar
  630.                                             x:Name="PART_VerticalScrollBar"
  631.                                             Grid.Row="0"
  632.                                             Grid.Column="1"
  633.                                             Maximum="{TemplateBinding ScrollableHeight}"
  634.                                             ViewportSize="{TemplateBinding ViewportHeight}"
  635.                                             Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
  636.                                             Value="{TemplateBinding VerticalOffset}" />
  637.                                         <ScrollBar
  638.                                             x:Name="PART_HorizontalScrollBar"
  639.                                             Grid.Row="1"
  640.                                             Grid.Column="0"
  641.                                             Maximum="{TemplateBinding ScrollableWidth}"
  642.                                             Orientation="Horizontal"
  643.                                             ViewportSize="{TemplateBinding ViewportWidth}"
  644.                                             Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
  645.                                             Value="{TemplateBinding HorizontalOffset}" />
  646.                                     </Grid>
  647.                                 </ControlTemplate>
  648.                             </Setter.Value>
  649.                         </Setter>
  650.                     </Style>
  651.                 </ScrollViewer.Resources>
  652.                 <RichTextBox
  653.                     x:Name="InternalRichTextBox"
  654.                     Margin="8"
  655.                     Background="#0f0f0f"
  656.                     BorderThickness="0"
  657.                     Focusable="True"
  658.                     FontFamily="/Voidwalker Engine Editor;component/Editor/Resources/Fonts/#Droid Sans Mono"
  659.                     FontSize="10"
  660.                     IsReadOnly="True"
  661.                     Loaded="InternalRichTextBox_Loaded" />
  662.             </ScrollViewer>
  663.  
  664.         </Border>
  665.  
  666.         <Grid Grid.Row="4" Grid.Column="1">
  667.             <Grid.ColumnDefinitions>
  668.                 <ColumnDefinition Width="Auto" />
  669.                 <ColumnDefinition Width="4" />
  670.                 <ColumnDefinition />
  671.             </Grid.ColumnDefinitions>
  672.             <Label Content="Cmd:" Foreground="{DynamicResource LightForeground1SolidColorBrush}" />
  673.             <TextBox
  674.                 x:Name="CommandTextBox"
  675.                 Grid.Row="4"
  676.                 Grid.Column="2"
  677.                 Background="#0f0f0f"
  678.                 BorderBrush="#454545"
  679.                 Foreground="White"
  680.                 PreviewKeyDown="CommandTextBox_PreviewKeyDown" />
  681.         </Grid>
  682.  
  683.  
  684.  
  685.     </Grid>
  686. </UserControl>
  687.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement