Forums

Space Engineers style example
Last Post 29 Jun 2015 10:17 AM by Filip Dušek. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Filip DušekUser is Offline
Advanced Member
Advanced Member
Posts:676


--
29 Jun 2015 10:17 AM
    Latest release focus (1.7.5) was better styling support. I tested all changes in real scenario - Space Engineers http://store.steampowered.com/app/244850

    I created render support for UI and style, which is pretty much the same like original UI. I can share this style with you. Space Engineers UI is image based. I implemented style for basic controls and tested all features. Feel free to use it (MIT).

    
    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/...tion"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:m="clr-namespace:GameModels;assembly=GameModels">
    
        <ImageBrush x:Key="ButtonBackgroundBrush">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\button_default.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ButtonBackgroundHoverBrush">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\button_default_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ButtonBackgroundPressedBrush">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\button_default_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ButtonBackgroundFocusedBrush">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\button_default_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <SolidColorBrush x:Key="ButtonTextColor" Color="White" />
        <SolidColorBrush x:Key="ButtonTextPressedColor" Color="White" />
        <SolidColorBrush x:Key="ButtonTextHoverColor" Color="Gray" />
        <SolidColorBrush x:Key="ButtonTextFocusedColor" Color="Gray" />
    
        <ImageBrush x:Key="KeenLogo" Stretch="Uniform">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\Gui\KeenLogo.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <Style TargetType="Button">
            <Setter Property="Background" Value="{DynamicResource ButtonBackgroundBrush}" />
            <Setter Property="Foreground" Value="{DynamicResource ButtonTextColor}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Padding="5">
                            <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter Property="Background" Value="{DynamicResource ButtonBackgroundPressedBrush}" />
                                <Setter Property="Foreground" Value="{DynamicResource ButtonTextPressedColor}" />
                            </Trigger>
                            <Trigger Property="IsFocused" Value="true">
                                <Setter Property="Background" Value="{DynamicResource ButtonBackgroundFocusedBrush}" />
                                <Setter Property="Foreground" Value="{DynamicResource ButtonTextFocusedColor}" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Background" Value="{DynamicResource ButtonBackgroundHoverBrush}" />
                                <Setter Property="Foreground" Value="{DynamicResource ButtonTextHoverColor}" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <ImageBrush x:Key="CheckBoxBackgroundBrush">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\checkbox_unchecked.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="CheckBoxHoverBackgroundBrush">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\checkbox_unchecked_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="CheckImageBrush">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\checkbox_checked.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <Style TargetType="CheckBox">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="CheckBox">
                        <StackPanel Orientation="Horizontal">
                            <Grid>
                                <Border Name="PART_NotChecked" Background="{DynamicResource CheckBoxBackgroundBrush}" Width="32" Height="32" />
                                <Border Name="PART_CheckMark" Background="{DynamicResource CheckImageBrush}" Width="32" Height="32" Visibility="Collapsed" />
                            </Grid>
                            <ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" />
                        </StackPanel>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="True">
                                <Setter Property="Visibility" Value="Visible" TargetName="PART_CheckMark" />
                            </Trigger>
                            <Trigger Property="IsChecked" Value="False">
                                <Setter Property="Visibility" Value="Collapsed" TargetName="PART_CheckMark" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Background" Value="{DynamicResource CheckBoxHoverBackgroundBrush}" TargetName="PART_NotChecked" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <BitmapImage x:Key="ComboBoxBackgroundCenter" UriSource="/Textures\GUI\Controls\combobox_default_center.dds" />
        <BitmapImage x:Key="ComboBoxBackgroundLeft" UriSource="/Textures\GUI\Controls\combobox_default_left.dds" />
        <BitmapImage x:Key="ComboBoxBackgroundRight" UriSource="/Textures\GUI\Controls\combobox_default_right.dds" />
        <BitmapImage x:Key="ComboBoxBackgroundCenterHighligt" UriSource="/Textures\GUI\Controls\combobox_default_highlight_center.dds" />
        <BitmapImage x:Key="ComboBoxBackgroundLeftHighligt" UriSource="/Textures\GUI\Controls\combobox_default_highlight_left.dds" />
        <BitmapImage x:Key="ComboBoxBackgroundRightHighligt" UriSource="/Textures\GUI\Controls\combobox_default_highlight_right.dds" />
    
    
        <Style TargetType="ComboBox">
            <Setter Property="Foreground" Value="{DynamicResource ButtonTextColor}" />
            <Setter Property="Height" Value="32" />
            <Setter Property="MaxDropDownHeight" Value="150" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBox">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="16"/>
                                <ColumnDefinition/>
                                <ColumnDefinition Width="32"/>
                            </Grid.ColumnDefinitions>
    
                            <Image Name="PART_ComboBoxLeft" Source="{DynamicResource ComboBoxBackgroundLeft}" SnapsToDevicePixels="True" />
                            <Image Name="PART_ComboBoxCenter" Source="{DynamicResource ComboBoxBackgroundCenter}" Grid.Column="1" Stretch="Fill" SnapsToDevicePixels="True" />
                            <Image Name="PART_ComboBoxRight" Source="{DynamicResource ComboBoxBackgroundRight}" Grid.Column="2" SnapsToDevicePixels="True"/>
    
                            <ToggleButton Name="PART_Button" ClickMode="Press" Grid.ColumnSpan="3" IsTabStop="False" Focusable="False" IsChecked="{TemplateBinding IsDropDownOpen}">
                                <ToggleButton.Style>
                                    <Style TargetType="ToggleButton">
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="ToggleButton">
                                                    <ContentPresenter Content="{TemplateBinding Content}" />
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </ToggleButton.Style>
                            </ToggleButton>
    
                            <ContentPresenter Content="{TemplateBinding SelectionBoxItem}" Grid.Column="1" IsHitTestVisible="False" />
    
                            <Popup Name="PART_Popup" MaxHeight="{TemplateBinding MaxDropDownHeight}" IsOpen="{TemplateBinding IsDropDownOpen}" Grid.ColumnSpan="3">
                                <ScrollViewer>
                                    <StackPanel IsItemsHost="True" Margin="16,0,0,0"/>
                                </ScrollViewer>
                            </Popup>
    
                        </Grid>
    
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Source" Value="{DynamicResource ComboBoxBackgroundLeftHighligt}" TargetName="PART_ComboBoxLeft" />
                                <Setter Property="Source" Value="{DynamicResource ComboBoxBackgroundCenterHighligt}" TargetName="PART_ComboBoxCenter" />
                                <Setter Property="Source" Value="{DynamicResource ComboBoxBackgroundRightHighligt}" TargetName="PART_ComboBoxRight" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <Style TargetType="ComboBoxItem">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBoxItem">
                        <ContentPresenter Content="{TemplateBinding Content}" />
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsHighlighted" Value="True" >
                                <Setter Property="Foreground">
                                    <Setter.Value>
                                        <SolidColorBrush Color="Gray" />
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True" >
                                <Setter Property="Foreground">
                                    <Setter.Value>
                                        <SolidColorBrush Color="Gray" />
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <ImageBrush x:Key="ScrollbarVerticalThumbCenter" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollbar_v_thumb_center.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollbarVerticalThumbTop" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollbar_v_thumb_top.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollbarVerticalThumbBottom" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollbar_v_thumb_bottom.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollbarVerticalThumbCenterHighlight" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollbar_v_thumb_center_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollbarVerticalThumbTopHighlight" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollbar_v_thumb_top_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollbarVerticalThumbBottomHighlight" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollbar_v_thumb_bottom_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <Style x:Key="VerticalThumb" TargetType="Thumb">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Thumb">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="32" />
                                <RowDefinition />
                                <RowDefinition Height="16" />
                            </Grid.RowDefinitions>
    
                            <Border Name="PART_Top" Background="{DynamicResource ScrollbarVerticalThumbTop}" />
                            <Border Name="PART_Center" Background="{DynamicResource ScrollbarVerticalThumbCenter}" Grid.Row="1"/>
                            <Border Name="PART_Bottom" Background="{DynamicResource ScrollbarVerticalThumbBottom}" Grid.Row="2"/>
                        </Grid>
    
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="{DynamicResource ScrollbarVerticalThumbTopHighlight}" TargetName="PART_Top" />
                                <Setter Property="Background" Value="{DynamicResource ScrollbarVerticalThumbCenterHighlight}" TargetName="PART_Center" />
                                <Setter Property="Background" Value="{DynamicResource ScrollbarVerticalThumbBottomHighlight}" TargetName="PART_Bottom" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <Style x:Key="ScrollBarPageButton" TargetType="RepeatButton">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <Style TargetType="ScrollBar">
            <Style.Triggers>
                <Trigger Property="Orientation" Value="Vertical">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ScrollBar">
                                <Grid>
                                    <Track Name="PART_Track" IsDirectionReversed="True">
                                        <Track.Thumb>
                                            <Thumb Style="{DynamicResource VerticalThumb}" />
                                        </Track.Thumb>
                                        <Track.IncreaseRepeatButton>
                                            <RepeatButton ClickMode="Press" IsTabStop="False" Style="{DynamicResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
                                        </Track.IncreaseRepeatButton>
                                        <Track.DecreaseRepeatButton>
                                            <RepeatButton ClickMode="Press" IsTabStop="False" Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" />
                                        </Track.DecreaseRepeatButton>
                                    </Track>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>
    
        <ImageBrush x:Key="ScrollableListLeftTop" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollable_list_left_top.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollableListLeftCenter" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollable_list_left_center.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollableListLeftBottom" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollable_list_left_bottom.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollableListCenterTop" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollable_list_center_top.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollableListCenter" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollable_list_center.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollableListCenterBottom" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollable_list_center_bottom.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollableListRightTop" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollable_list_right_top.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollableListRightCenter" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollable_list_right_center.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="ScrollableListRightBottom" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\scrollable_list_right_bottom.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <Style TargetType="ScrollViewer">
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ScrollViewer">
                        <Grid SnapsToDevicePixels="True">
    
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="4"/>
                                <ColumnDefinition />
                                <ColumnDefinition Width="32"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="4" />
                                <RowDefinition />
                                <RowDefinition Height="4" />
                            </Grid.RowDefinitions>
    
                            <Border Background="{DynamicResource ScrollableListLeftTop}" IsHitTestVisible="False"/>
                            <Border Background="{DynamicResource ScrollableListCenterTop}" Grid.Column="1" IsHitTestVisible="False"/>
                            <Border Background="{DynamicResource ScrollableListRightTop}" Grid.Column="2" IsHitTestVisible="False"/>
                            <Border Background="{DynamicResource ScrollableListLeftCenter}" Grid.Row="1" IsHitTestVisible="False"/>
                            <Border Background="{DynamicResource ScrollableListCenter}" Grid.Row="1" Grid.Column="1" IsHitTestVisible="False"/>
                            <Border Background="{DynamicResource ScrollableListRightCenter}" Grid.Row="1" Grid.Column="2" IsHitTestVisible="False"/>
                            <Border Background="{DynamicResource ScrollableListLeftBottom}" Grid.Row="2" IsHitTestVisible="False"/>
                            <Border Background="{DynamicResource ScrollableListCenterBottom}" Grid.Row="2" Grid.Column="1" IsHitTestVisible="False"/>
                            <Border Background="{DynamicResource ScrollableListRightBottom}" Grid.Row="2" Grid.Column="2" IsHitTestVisible="False"/>
    
                            <ScrollContentPresenter Name="PART_ScrollContentPresenter" SnapsToDevicePixels="True" Grid.Row="1" Grid.Column="1" Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}"
                                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
    
                            <ScrollBar Name="PART_VerticalScrollBar" Orientation="Vertical" Grid.Row="1" Grid.Column="2" Minimum="0"
                                       Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{TemplateBinding VerticalOffset}"
                                       ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" />
    
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">
            <Setter Property="SnapsToDevicePixels" Value="true" />
            <Setter Property="Focusable" Value="false" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Border Background="Transparent">
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <ImageBrush x:Key="SliderThumb" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\slider_thumb.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="SliderThumbHighlight" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\slider_thumb_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <Style x:Key="SliderThumbStyle" TargetType="{x:Type Thumb}">
            <Setter Property="SnapsToDevicePixels" Value="true" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <Border Name="PART_SliderThumb" Background="{DynamicResource SliderThumb}" SnapsToDevicePixels="True" Width="20" Height="20"/>
    
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="{DynamicResource SliderThumbHighlight}" TargetName="PART_SliderThumb" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <ImageBrush x:Key="SliderRailCenter" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\slider_rail_center.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="SliderRailLeft" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\slider_rail_left.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="SliderRailRight" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\slider_rail_right.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="SliderRailCenterHighlight" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\slider_rail_center_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="SliderRailLeftHighlight" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\slider_rail_left_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="SliderRailRightHighlight" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\slider_rail_right_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ControlTemplate x:Key="HorizontalSlider" TargetType="{x:Type Slider}">
            <Grid Height="32">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="12" />
                    <ColumnDefinition />
                    <ColumnDefinition Width="12"/>
                </Grid.ColumnDefinitions>
                <Border Name="PART_SliderRailLeft" Background="{DynamicResource SliderRailLeft}" IsHitTestVisible="False"/>
                <Border Name="PART_SliderRailCenter" Grid.Column="1" Background="{DynamicResource SliderRailCenter}" IsHitTestVisible="False"/>
                <Border Name="PART_SliderRailRight" Grid.Column="2" Background="{DynamicResource SliderRailRight}" IsHitTestVisible="False"/>
                <Track Name="PART_Track" Grid.ColumnSpan="3" Margin="6,0,6,0">
                    <Track.DecreaseRepeatButton>
                        <RepeatButton Style="{DynamicResource SliderButtonStyle}" ClickMode="Press"/>
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb Style="{DynamicResource SliderThumbStyle}" />
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton Style="{DynamicResource SliderButtonStyle}" ClickMode="Press"/>
                    </Track.IncreaseRepeatButton>
                </Track>
            </Grid>
    
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="{DynamicResource SliderRailLeftHighlight}" TargetName="PART_SliderRailLeft" />
                    <Setter Property="Background" Value="{DynamicResource SliderRailCenterHighlight}" TargetName="PART_SliderRailCenter" />
                    <Setter Property="Background" Value="{DynamicResource SliderRailRightHighlight}" TargetName="PART_SliderRailRight" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    
        <Style TargetType="{x:Type Slider}">
            <Setter Property="SnapsToDevicePixels" Value="true" />
            <Setter Property="Template" Value="{DynamicResource HorizontalSlider}" />
        </Style>
    
        <Style TargetType="TabItem">
            <Setter Property="Background" Value="{DynamicResource ButtonBackgroundBrush}" />
            <Setter Property="Foreground" Value="{DynamicResource ButtonTextColor}" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TabItem">
                        <Border Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Padding="5">
                            <ContentPresenter Content="{TemplateBinding Header}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,2,10,2" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected" Value="true">
                                <Setter Property="Background" Value="{DynamicResource ButtonBackgroundPressedBrush}" />
                                <Setter Property="Foreground" Value="{DynamicResource ButtonTextPressedColor}" />
                            </Trigger>
                            <Trigger Property="IsFocused" Value="true">
                                <Setter Property="Background" Value="{DynamicResource ButtonBackgroundFocusedBrush}" />
                                <Setter Property="Foreground" Value="{DynamicResource ButtonTextFocusedColor}" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Background" Value="{DynamicResource ButtonBackgroundHoverBrush}" />
                                <Setter Property="Foreground" Value="{DynamicResource ButtonTextHoverColor}" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <ImageBrush x:Key="WindowBackgroundBrush" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Screens\screen_background.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <Style TargetType="Window">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Window">
                        <Grid Background="{DynamicResource WindowBackgroundBrush}">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Border Name="PART_WindowTitleBorder">
                                <ContentPresenter Name="PART_WindowTitle" Content="{TemplateBinding Title}" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False" />
                            </Border>
                            <ScrollViewer Margin="20" Grid.Row="1" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled">
                                <ContentPresenter Content="{TemplateBinding Content}" />
                            </ScrollViewer>
                            <Border Name="PART_WindowResizeBorder" Width="16" Height="16" HorizontalAlignment="Right" Grid.Row="2" Background="Black" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <ImageBrush x:Key="MessageBackgroundBrush" Stretch="Fill">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Screens\message_background_red.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="RedButtonBackgroundBrush">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\button_red.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="RedButtonBackgroundBrushHighlight">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\button_red_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <Style x:Key="MessageBoxWindowStyle" TargetType="Window">
            <Setter Property="Foreground" Value="Red" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Window">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>
    
                            <Grid Background="{DynamicResource MessageBackgroundBrush}" Grid.Column="1" SnapsToDevicePixels="True">
                                <Grid.Resources>
                                    <Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
                                        <Setter Property="Background" Value="{DynamicResource RedButtonBackgroundBrush}" />
                                        <Setter Property="Foreground" Value="{DynamicResource ButtonTextColor}" />
                                        <Setter Property="Width" Value="200" />
                                        <Setter Property="Template">
                                            <Setter.Value>
                                                <ControlTemplate TargetType="Button">
                                                    <Border Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Padding="5">
                                                        <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                                    </Border>
                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="IsPressed" Value="true">
                                                            <Setter Property="Background" Value="{DynamicResource RedButtonBackgroundBrushHighlight}" />
                                                            <Setter Property="Foreground" Value="Red" />
                                                        </Trigger>
                                                        <Trigger Property="IsFocused" Value="true">
                                                            <Setter Property="Background" Value="{DynamicResource RedButtonBackgroundBrushHighlight}" />
                                                            <Setter Property="Foreground" Value="{DynamicResource ButtonTextFocusedColor}" />
                                                        </Trigger>
                                                        <Trigger Property="IsMouseOver" Value="true">
                                                            <Setter Property="Background" Value="{DynamicResource RedButtonBackgroundBrushHighlight}" />
                                                            <Setter Property="Foreground" Value="Red" />
                                                        </Trigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                            </Setter.Value>
                                        </Setter>
                                    </Style>
                                </Grid.Resources>
    
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <ContentPresenter Name="PART_WindowTitle" Content="{TemplateBinding Title}" Margin="10,10,10,0"
                                                  HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False" />
                                <ContentPresenter Content="{TemplateBinding Content}" Grid.Row="1" Margin="10" HorizontalAlignment="Center"/>
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <ImageBrush x:Key="TextBoxCenter">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\textbox_center.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="TextBoxCenterHighlight">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\textbox_center_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="TextBoxLeft">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\textbox_left.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="TextBoxLeftHighlight">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\textbox_left_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="TextBoxRight">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\textbox_right.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <ImageBrush x:Key="TextBoxRightHighlight">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\textbox_right_highlight.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    
        <Style x:Key="TextBoxScrollViewer" TargetType="ScrollViewer">
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ScrollViewer">
                        <ScrollContentPresenter Name="PART_ScrollContentPresenter" SnapsToDevicePixels="True" 
                            Content="{TemplateBinding Content}" Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    
        <Style TargetType="TextBox">
            <Setter Property="CaretBrush" Value="White" />
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="4" />
                                <ColumnDefinition />
                                <ColumnDefinition Width="4"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition MinHeight="36" />
                            </Grid.RowDefinitions>
    
                            <Border Name="PART_TextBoxLeft" Background="{DynamicResource TextBoxLeft}" IsHitTestVisible="False"/>
                            <Border Name="PART_TextBoxCenter" Grid.Column="1" Background="{DynamicResource TextBoxCenter}" IsHitTestVisible="False"/>
                            <Border Name="PART_TextBoxRight" Grid.Column="2" Background="{DynamicResource TextBoxRight}" IsHitTestVisible="False"/>
    
                            <ScrollViewer Name="PART_ScrollViewer" Margin="0,4,0,4" Grid.Column="1" Style="{DynamicResource TextBoxScrollViewer}" 
                                          HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                                <TextBlock Text="{TemplateBinding Text}" TextAlignment="{TemplateBinding TextAlignment}" VerticalAlignment="Center"
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" />
                            </ScrollViewer>
                        </Grid>
    
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="{DynamicResource TextBoxLeftHighlight}" TargetName="PART_TextBoxLeft" />
                                <Setter Property="Background" Value="{DynamicResource TextBoxCenterHighlight}" TargetName="PART_TextBoxCenter" />
                                <Setter Property="Background" Value="{DynamicResource TextBoxRightHighlight}" TargetName="PART_TextBoxRight" />
                            </Trigger>
                            <Trigger Property="IsFocused" Value="True">
                                <Setter Property="Background" Value="{DynamicResource TextBoxLeftHighlight}" TargetName="PART_TextBoxLeft" />
                                <Setter Property="Background" Value="{DynamicResource TextBoxCenterHighlight}" TargetName="PART_TextBoxCenter" />
                                <Setter Property="Background" Value="{DynamicResource TextBoxRightHighlight}" TargetName="PART_TextBoxRight" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>    
    
        <ImageBrush x:Key="GridItem">
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="/Textures\GUI\Controls\grid_item.dds" />
            </ImageBrush.ImageSource>
        </ImageBrush>
        
        <DataTemplate DataType="{x:Type m:ItemModel}">
            <Border Background="{DynamicResource GridItem}" Width="64" Height="64">
                <Image Stretch="Fill">
                    <Image.Source>
                        <BitmapImage UriSource="/Textures\GUI\Icons\WeaponDrill.dds" />
                    </Image.Source>
                </Image>
            </Border>
        </DataTemplate>
    
        <Style x:Key="ListBoxWrapPanel" TargetType="ListBox">
            <Setter Property="MinHeight" Value="80" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBox">
                        <Border SnapsToDevicePixels="True">
                            <ScrollViewer HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                                <WrapPanel ItemHeight="64" ItemWidth="64" IsItemsHost="True" />
                            </ScrollViewer>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>        
        </Style>
    
    </ResourceDictionary>
    
    
    You are not authorized to post a reply.