<!--
Styles.xaml
12/4/2023

RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION
PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS
AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO
UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO
RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS
CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS
OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON
COMPANY.

THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. GOVERNMENT

UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.

WARNING: THIS DOCUMENT CONTAINS TECHNICAL DATA AND / OR TECHNOLOGY WHOSE
EXPORT OR DISCLOSURE TO NON-U.S. PERSONS, WHEREVER LOCATED, IS RESTRICTED
BY THE INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) (22 C.F.R. SECTION
120-130) OR THE EXPORT ADMINISTRATION REGULATIONS (EAR) (15 C.F.R. SECTION
730-774). THIS DOCUMENT CANNOT BE EXPORTED (E.G., PROVIDED TO A SUPPLIER
OUTSIDE OF THE UNITED STATES) OR DISCLOSED TO A NON-U.S. PERSON, WHEREVER
LOCATED, UNTIL A FINAL JURISDICTION AND CLASSIFICATION DETERMINATION HAS
BEEN COMPLETED AND APPROVED BY RAYTHEON, AND ANY REQUIRED U.S. GOVERNMENT
APPROVALS HAVE BEEN OBTAINED. VIOLATIONS ARE SUBJECT TO SEVERE CRIMINAL
PENALTIES.

DOD 5220.22-M, INDUSTRIAL SECURITY MANUAL, CHAPTER 5, SECTION 1 THROUGH 9 :
FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN OR DOD 5200.1-R,
INFORMATION SECURITY PROGRAM, CHAPTER 6. FOR UNCLASSIFIED, LIMITED DOCUMENTS
DESTROY BY ANY  METHOD THAT WILL PREVENT DISCLOSURE OF CONTENTS OR
RECONSTRUCTION OF THE DOCUMENT.
POC: Alex Kravchenko (1118268)
-->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:converters="clr-namespace:Raytheon.LogDashboard.Converters"
                    xmlns:helpers="clr-namespace:Raytheon.LogDashboard.Helpers"
                    xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
                    >

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="DrawingImages.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <BooleanToVisibilityConverter x:Key="BooleanToVisibility"/>
    <converters:MaxLengthConverter x:Key="LengthConverter" />
    <converters:LoggerDisplayConverter x:Key="LoggerDisplayConverter"/>
    <converters:DataConverter x:Key="DataConverter"/>
    <converters:ProgressStateConverter x:Key="ProgressStateConverter"/>
    <converters:CountToVisibilityConverter x:Key="CountToVisibilityConverter"/>

    <sys:Boolean x:Key="True">True</sys:Boolean>
    <sys:Boolean x:Key="False">False</sys:Boolean>

    <Style x:Key="TextBoxWithHint" BasedOn="{StaticResource MahApps.Styles.TextBox}" TargetType="{x:Type TextBox}">
        <Style.Resources>
            <VisualBrush x:Key="CueBannerBrush" AlignmentX="Left" AlignmentY="Center" Stretch="None">
                <VisualBrush.Visual>
                    <Label Padding="5,0,0,0" Content="Search" Foreground="LightGray" />
                </VisualBrush.Visual>
            </VisualBrush>
        </Style.Resources>
        <Style.Triggers>
            <Trigger Property="Text" Value="{x:Static sys:String.Empty}">
                <Setter Property="Background" Value="{StaticResource CueBannerBrush}" />
            </Trigger>
            <Trigger Property="Text" Value="{x:Null}">
                <Setter Property="Background" Value="{StaticResource CueBannerBrush}" />
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True">
                <Setter Property="Background" Value="Red" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type Button}" BasedOn="{StaticResource MahApps.Styles.Button.MetroSquare.Accent}">
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
        <Setter Property="Background" Value="Transparent" />
    </Style>

    <Style x:Key="BaseButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource MahApps.Styles.Button.MetroSquare.Accent}">
        <Setter Property="Height" Value="30"/>
        <Setter Property="Width" Value="150"/>
        <Setter Property="Margin" Value="10"/>
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
        <Setter Property="BorderThickness" Value="0" />
        <!--<Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property = "Background" Value="WhiteSmoke"/>
            </Trigger>
        </Style.Triggers>-->
    </Style>

    <!--<Style x:Key="DataGridCellStyle" TargetType="TextBlock">
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="Height" Value="Auto"/>
    </Style>-->

    <Style x:Key="DataGridCellWrapStyle" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MahApps.Styles.TextBox}">
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Height" Value="Auto"/>
        <Setter Property="MaxHeight" Value="350"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="False"/>
    </Style>

    <Style BasedOn="{StaticResource MahApps.Styles.TextBox}" TargetType="{x:Type TextBox}">
        <Setter Property="FontSize" Value="14" />
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Height" Value="30"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{Binding IconColor}" />
        <!--<Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property = "Background" Value="WhiteSmoke"/>
            </Trigger>
        </Style.Triggers>-->
    </Style>

    <Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource MahApps.Styles.TextBlock}">
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Margin" Value="10,4"/>
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=Text }"/>
    </Style>

    <Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource MahApps.Styles.ComboBox}">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Margin" Value="0,4"/>
        <Setter Property="FontSize" Value="14"/>
    </Style>

    <Style x:Key="CircleImageButtonStyle" TargetType="Button" BasedOn="{StaticResource MahApps.Styles.Button.Hamburger}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Height" Value="24"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Margin" Value="5"/>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Cursor" Value="Hand"/>
            </Trigger>
        </Style.Triggers>

    </Style>

    <Style x:Key="StartPauseNetworkReceiverButtonStyle" TargetType="Button" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
        <Setter Property="Margin" Value="2,0" />
        <Setter Property="Height" Value="26"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=StartIsEnabled}" Value="True">
                <Setter Property="ToolTip" Value="Start Reading Logs from Predefined Receivers"/>
                <Setter Property="Command" Value="{Binding Path=StartCommand}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                                <Image Source="{StaticResource PlayImage}" Cursor="Hand"/>
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property ="IsPressed" Value ="True">
                                    <Setter TargetName="RootGrid" Property="RenderTransform">
                                        <Setter.Value>
                                            <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path=StartIsEnabled}" Value="False">
                <Setter Property="ToolTip" Value="Stop Reading Logs from Predefined Receivers"/>
                <Setter Property="Margin" Value="2,0" />
                <Setter Property="Command" Value="{Binding Path=PauseCommand}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                                <Image Source="{StaticResource PauseImage}" Cursor="Hand"/>
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property ="IsPressed" Value ="True">
                                    <Setter TargetName="RootGrid" Property="RenderTransform">
                                        <Setter.Value>
                                            <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="StartPauseFileReceiverButtonStyle" TargetType="Button" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
        <Setter Property="ToolTipService.ShowOnDisabled" Value="True"/>
        <Setter Property="Margin" Value="2,0" />
        <Setter Property="Height" Value="26"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=StartReadFromFileIsEnabled}" Value="True">
                <Setter Property="ToolTip" Value="Start Reading Logs from File}"/>
                <Setter Property="Command" Value="{Binding Path=StartFileReadingCommand}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                                <Image Source="{StaticResource StartReadFromFileImage}" Cursor="Hand"/>
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property ="IsPressed" Value ="True">
                                    <Setter TargetName="RootGrid" Property="RenderTransform">
                                        <Setter.Value>
                                            <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </DataTrigger>

            <DataTrigger Binding="{Binding Path=StartReadFromFileIsEnabled}" Value="False">
                <Setter Property="ToolTip" Value="Stop Reading Logs from File"/>
                <Setter Property="Command" Value="{Binding Path=PauseFileReadingCommand}"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                                <Image Source="{StaticResource PauseReadingFromFileImage}" Cursor="Hand"/>
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property ="IsPressed" Value ="True">
                                    <Setter TargetName="RootGrid" Property="RenderTransform">
                                        <Setter.Value>
                                            <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="SettingsButtonStyle" TargetType="Button" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
        <Setter Property="ToolTip" Value="Settings"/>
        <Setter Property="Height" Value="26"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                        <Image Source="{StaticResource SettingImage}" Cursor="Hand"/>
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property ="IsPressed" Value ="True">
                            <Setter TargetName="RootGrid" Property="RenderTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TreeButtonStyle" TargetType="Button" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
        <Setter Property="ToolTip" Value="Expand Tree View"/>
        <Setter Property="Height" Value="26"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                        <Image Source="{StaticResource TreeImage}" Cursor="Hand"/>
                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property ="IsPressed" Value ="True">
                            <Setter TargetName="RootGrid" Property="RenderTransform">
                                <Setter.Value>
                                    <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="ScrollToTop" TargetType="{x:Type Button}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
        <Setter Property="ToolTip" Value="Scroll to First Log Message"/>
        <Setter Property="Margin" Value="2,0" />
        <Setter Property="Height" Value="26"/>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="True">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                                <Image Source="{StaticResource UpImage}" Cursor="Hand"/>
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property ="IsPressed" Value ="True">
                                    <Setter TargetName="RootGrid" Property="RenderTransform">
                                        <Setter.Value>
                                            <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="AutoScrollToBottom" TargetType="{x:Type Button}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
        <Setter Property="Height" Value="26"/>
        <Setter Property="Margin" Value="2,0" />
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="True">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                                <Image Source="{StaticResource AutoDownImage}" Cursor="Hand"/>
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property ="IsPressed" Value ="True">
                                    <Setter TargetName="RootGrid" Property="RenderTransform">
                                        <Setter.Value>
                                            <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="ScrollToBottom" TargetType="{x:Type Button}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
        <Setter Property="Height" Value="26"/>
        <Setter Property="Margin" Value="2,0" />
        <Setter Property="ToolTip" Value="Scroll to Last Log Message"/>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="True">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                                <Image Source="{StaticResource DownImage}" Cursor="Hand"/>
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property ="IsPressed" Value ="True">
                                    <Setter TargetName="RootGrid" Property="RenderTransform">
                                        <Setter.Value>
                                            <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="GridViewColumnHeaderGripper" TargetType="Thumb">
        <Setter Property="Width" Value="18" />
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <LinearGradientBrush.GradientStops>
                        <GradientStopCollection>
                            <GradientStop Color="{DynamicResource BorderLightColor}" Offset="0.0" />
                            <GradientStop Color="{DynamicResource BorderDarkColor}" Offset="1.0" />
                        </GradientStopCollection>
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Padding="{TemplateBinding Padding}" Background="Transparent">
                        <Rectangle HorizontalAlignment="Center" Width="1" Fill="{TemplateBinding Background}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0" />
                    <GradientStop Color="White" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="BaseGridViewColumnHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="FontSize" Value="14" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                    <Grid>
                        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,15" FontWeight="DemiBold" Foreground="Gray" x:Name="contentTB">
                            <ContentPresenter/>
                        </TextBlock>

                        <Thumb x:Name="PART_HeaderGripper"
                               HorizontalAlignment="Right"
                               Margin="0,0,-9,0"
                               Style="{StaticResource GridViewColumnHeaderGripper}" />
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="contentTB" Property="Foreground" Value="Black"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Cursor" Value="Hand"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="SearchGridViewColumnHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="FontSize" Value="14" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                    <Grid>
                        <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,15" FontWeight="DemiBold" Foreground="Gray" x:Name="contentTB">
                            <ContentPresenter/>
                        </TextBlock>

                        <Thumb x:Name="PART_HeaderGripper"
                               HorizontalAlignment="Right"
                               Margin="0,0,-9,0"
                               Style="{StaticResource GridViewColumnHeaderGripper}" />
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="contentTB" Property="Foreground" Value="Black"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Cursor" Value="Hand"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="IpGridViewColumnHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="FontSize" Value="14" />
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                    <Grid>
                        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,15" FontWeight="DemiBold" Foreground="Gray" x:Name="contentTB">
                            <ContentPresenter/>
                        </TextBlock>

                        <Thumb x:Name="PART_HeaderGripper"
                               HorizontalAlignment="Right"
                               Margin="0,0,-9,0"
                               Style="{StaticResource GridViewColumnHeaderGripper}" />
                    </Grid>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="contentTB" Property="Foreground" Value="Black"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Cursor" Value="Hand"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="LogLevelHeaderTemplate" TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource BaseGridViewColumnHeaderStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                    <StackPanel Orientation="Horizontal" >
                        <ComboBox Margin="2" ItemsSource="{Binding Path=DataContext.LogLevels, RelativeSource={RelativeSource AncestorType=mah:MetroContentControl}}" 
                                  SelectedItem="{Binding Path=DataContext.SelectedMinLogLevel, RelativeSource={RelativeSource AncestorType=mah:MetroContentControl}}">
                            <ComboBox.ItemTemplate>
                                <DataTemplate DataType="ComboBoxItem">
                                    <StackPanel Orientation="Horizontal" Margin="0" Height="20">
                                        <Image x:Name="ImageLevel" Height="15" Source="{StaticResource TraceImage}" Margin="2"/>
                                        <TextBlock Text="{Binding}" 
                                                   VerticalAlignment="Center" 
                                                   FontWeight="DemiBold" 
                                                   FontSize="14"
                                                   Foreground="Gray" 
                                                   x:Name="contentTB" />
                                    </StackPanel>

                                    <DataTemplate.Triggers>
                                        <DataTrigger  Binding="{Binding}" Value="Trace">
                                            <Setter TargetName="ImageLevel" Property="Source" Value="{StaticResource TraceImage}"/>
                                        </DataTrigger>
                                        <DataTrigger  Binding="{Binding}" Value="Debug">
                                            <Setter TargetName="ImageLevel" Property="Source" Value="{StaticResource DebugImage}"/>
                                        </DataTrigger>
                                        <DataTrigger  Binding="{Binding}" Value="Info">
                                            <Setter TargetName="ImageLevel" Property="Source" Value="{StaticResource InfoImage}"/>
                                        </DataTrigger>
                                        <DataTrigger  Binding="{Binding}" Value="Warn">
                                            <Setter TargetName="ImageLevel" Property="Source" Value="{StaticResource WarnImage}"/>
                                        </DataTrigger>
                                        <DataTrigger  Binding="{Binding}" Value="Error">
                                            <Setter TargetName="ImageLevel" Property="Source" Value="{StaticResource ErrorImage}"/>
                                        </DataTrigger>
                                        <DataTrigger  Binding="{Binding}" Value="Fatal">
                                            <Setter TargetName="ImageLevel" Property="Source" Value="{StaticResource FatalImage}"/>
                                        </DataTrigger>
                                    </DataTemplate.Triggers>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="FixedWithHeaderContainerStyle" TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource BaseGridViewColumnHeaderStyle}">
        <Setter Property="IsEnabled" Value="False"/>
    </Style>

    <DataTemplate x:Key="LogLevelImagesDataTemplate">
        <StackPanel Orientation="Horizontal">
            <Image Height="20" Width="20">
                <Image.Style>
                    <Style TargetType="{x:Type Image}">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Level}" Value="Warn">
                                <Setter Property="Source" Value="{StaticResource WarnImage}"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Level}" Value="Error">
                                <Setter Property="Source" Value="{StaticResource ErrorImage}"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Level}" Value="Fatal">
                                <Setter Property="Source" Value="{StaticResource FatalImage}"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Level}" Value="Info">
                                <Setter Property="Source" Value="{StaticResource InfoImage}"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Level}" Value="Debug">
                                <Setter Property="Source" Value="{StaticResource DebugImage}"/>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Level}" Value="Trace">
                                <Setter Property="Source" Value="{StaticResource TraceImage}"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Image.Style>
            </Image>
            <TextBlock Text="{Binding Path=Level}"
                       FontSize="14"
                       Margin="10,0,0,0" VerticalAlignment="Center"/>
        </StackPanel>

    </DataTemplate>

    <DataTemplate x:Key="ReceiverColorColumnDataTemplate">
        <Grid Background="{Binding Path=Color}" ToolTip="{Binding Path=Logger}">
            <Grid.Style>
                <Style TargetType="{x:Type Grid}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding DataContext.ColorReceiverColumnWidth, RelativeSource={RelativeSource AncestorType={x:Type mah:MetroContentControl}}}" Value="0">
                            <Setter Property="Margin" Value="0"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding DataContext.ColorReceiverColumnWidth, RelativeSource={RelativeSource AncestorType={x:Type mah:MetroContentControl}}}" Value="15">
                            <Setter Property="Margin" Value="-2, -13, -6, -13"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Grid.Style>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="LogMessageDataTemplate">
        <helpers:SearchableTextControl 
            Text="{Binding Path=Message, Converter={StaticResource LengthConverter}, ConverterParameter=800}"
            ToolTip="{Binding Path=Message}"
            HorizontalAlignment="Stretch"
            IsHighlight="True" 
            SearchText="{Binding Path=DataContext.HighlightSearchText, RelativeSource={RelativeSource AncestorType=mah:MetroContentControl}}"
            VerticalAlignment="Center" 
            IsMatchCase="{Binding Path=DataContext.IsMatchCase, RelativeSource={RelativeSource AncestorType=mah:MetroContentControl}}"/>
    </DataTemplate>

    <Style TargetType="{x:Type helpers:SearchableTextControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type helpers:SearchableTextControl}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <TextBlock FontSize="14" TextWrapping="Wrap" x:Name="PART_TEXT"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="BaseContextMenu" TargetType="{x:Type ContextMenu}">
        <Setter Property="FontSize" Value="16" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContextMenu}">
                    <Border x:Name="Border" CornerRadius="5"
                            Background="#F4F4F4"
                            BorderThickness="1">
                        <Border.BorderBrush>
                            <SolidColorBrush Color="Black" />
                        </Border.BorderBrush>
                        <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="TreeViewContextMenuItemStyle" TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}">
        <Setter Property="Header" Value="{Binding HeaderText}"/>
        <Setter Property="Command" Value="{Binding ActionCommand}"/>
        <Setter Property="CommandParameter" Value="{Binding}"/>
        <Setter Property="Icon" Value="{Binding IconImage}"/>
    </Style>

    <Style x:Key="MessageHeaderTemplate" TargetType="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource BaseGridViewColumnHeaderStyle}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                        <TextBlock Margin="6,0,0,0" Text="Message" VerticalAlignment="Center" FontWeight="DemiBold" Foreground="Gray" x:Name="contentTB"/>

                        <Border CornerRadius="2" Margin="10,0,0,0" Height="33" HorizontalAlignment="Right" Width="200">
                            <Border.Style>
                                <Style TargetType="{x:Type Border}">
                                    <Setter Property="BorderBrush" Value="{Binding FontColor}"/>
                                    <Setter Property="BorderThickness" Value="1"/>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsFocused, ElementName=SearchTextBox}" Value="True">
                                            <Setter Property="BorderBrush" Value="{Binding IconColor}" />
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Border.Style>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <TextBox BorderThickness="0"
                                         FontSize="14"
                                         Text="{Binding Path=SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                                         Margin="5,0,5,0" HorizontalAlignment="Stretch" VerticalContentAlignment="Center" 
                                         Name="SearchTextBox">

                                    <TextBox.InputBindings>
                                        <KeyBinding  Command="{Binding ElementName=LogsListView, Path=DataContext.SearchLogCommand}" 
                                                     CommandParameter="{StaticResource False}" Key="Return" />
                                    </TextBox.InputBindings>
                                </TextBox>

                                <Button Grid.Column="1" Margin="0,0,3,0" 
                                        Padding="0" Height="20" Width="20" 
                                        ToolTip="Clear Search and Search Results"
                                        Style="{StaticResource CircleImageButtonStyle}"
                                        Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=mah:MetroContentControl}}"
                                        Command="{Binding ElementName=LogsListView, Path=DataContext.ClearSearchResultCommand}" 
                                        Visibility="{Binding ElementName=LogsListView, Path= DataContext.ClearSearchResultIsEnabled, Converter={StaticResource BooleanToVisibility}}">
                                    <Button.Template>
                                        <ControlTemplate TargetType="{x:Type Button}">
                                            <Grid x:Name="RootGrid">
                                                <Image Source="{StaticResource CancelDrawingImage}" Cursor="Hand"/>
                                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                            </Grid>

                                            <ControlTemplate.Triggers>
                                                <Trigger Property ="IsPressed" Value ="True">
                                                    <Setter TargetName="RootGrid" Property="RenderTransform">
                                                        <Setter.Value>
                                                            <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                                        </Setter.Value>
                                                    </Setter>
                                                </Trigger>
                                            </ControlTemplate.Triggers>
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                            </Grid>
                        </Border>

                        <Button Height="32" Width="32" Margin="5,0" Padding="2" ToolTip="Find All Hot Keys"
                                Command="{Binding ElementName=LogsListView, Path=DataContext.SearchLogCommand}" 
                                Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType=mah:MetroContentControl}}" 
                                CommandParameter="{StaticResource False}">
                            <Button.ContextMenu>
                                <ContextMenu Style="{StaticResource BaseContextMenu}">
                                    <MenuItem Margin="0" Header="In Another Window (Ctrl+Shift+F)" 
                                              Command="{Binding PlacementTarget.Tag.SearchLogCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ContextMenu}}" CommandParameter="{StaticResource True}"/>
                                </ContextMenu>
                            </Button.ContextMenu>
                            <!-- Search button from the main menu -->
                            <Button.Style>
                                <Style TargetType="{x:Type Button}" BasedOn="{StaticResource CircleImageButtonStyle}">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding Text.Length, ElementName=SearchTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
                                            <Setter Property="IsEnabled" Value="False"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>
                            <Image Source="{StaticResource SearchDrawingImage}"/>
                        </Button>

                        <Button Height="32" Width="32" 
                                Padding="2" 
                                ToolTip="Find Previous Log Message (Ctrl+P)" 
                                Margin="0" 
                                Command="{Binding ElementName=LogsListView, Path=DataContext.FindPreviousCommand}" 
                                IsEnabled="{Binding ElementName=LogsListView, Path= DataContext.IsEnableFindPrevious}">
                            <Image Source="{StaticResource SearchPrevious}"/>
                            <Button.Style>
                                <Style TargetType="{x:Type Button}" BasedOn="{StaticResource CircleImageButtonStyle}">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding Text.Length, ElementName=SearchTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
                                            <Setter Property="IsEnabled" Value="False"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>
                        </Button>

                        <Button Height="32" Width="32" 
                                Padding="2" ToolTip="Find Next Log Message (Ctrl+N)" Margin="5,0" 
                                Command="{Binding ElementName=LogsListView, Path=DataContext.FindNextCommand}">
                            <Button.Style>
                                <Style TargetType="{x:Type Button}" BasedOn="{StaticResource CircleImageButtonStyle}">
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding Text.Length, ElementName=SearchTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
                                            <Setter Property="IsEnabled" Value="False"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Button.Style>
                            <Image Source="{StaticResource SearchNext}"/>
                        </Button>

                        <ToggleButton Margin="5,0" ToolTip="Match Case" IsChecked="{Binding ElementName=LogsListView, Path=DataContext.IsMatchCase}">
                            <ToggleButton.Template>
                                <ControlTemplate>
                                    <Border x:Name="toggleBorder" BorderThickness="0" Height="33" Width="33" BorderBrush="DeepSkyBlue">
                                        <Image Source="{StaticResource MatchCaseImage}" Margin="1"/>
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="ToggleButton.IsChecked" Value="True">
                                            <Setter Property="BorderThickness" TargetName="toggleBorder" Value="2"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </ToggleButton.Template>
                        </ToggleButton>

                        <ToggleButton Margin="0" ToolTip="Match Whole Word" IsChecked="{Binding ElementName=LogsListView, Path=DataContext.IsMatchWholeWord}">
                            <ToggleButton.Template>
                                <ControlTemplate>
                                    <Border x:Name="toggleBorder" BorderThickness="0" Height="33" BorderBrush="DeepSkyBlue">
                                        <Image Source="{StaticResource MatchWordDrawingImage}" Margin="2"/>
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="ToggleButton.IsChecked" Value="True">
                                            <Setter Property="BorderThickness" TargetName="toggleBorder" Value="2"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </ToggleButton.Template>
                        </ToggleButton>

                        <ToggleButton Margin="5,0" ToolTip="Match Log Level (Only for 'Find All')" IsChecked="{Binding ElementName=LogsListView, Path=DataContext.IsMatchLogLevel}">
                            <ToggleButton.Template>
                                <ControlTemplate>
                                    <Border x:Name="toggleBorder" BorderThickness="0" Height="33" BorderBrush="DeepSkyBlue">
                                        <Image Source="{StaticResource MatchLogLevelImage}" Margin="2"/>
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="ToggleButton.IsChecked" Value="True">
                                            <Setter Property="BorderThickness" TargetName="toggleBorder" Value="2"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </ToggleButton.Template>
                        </ToggleButton>

                        <ToggleButton Margin="5,0" ToolTip="Use Regular Expression" IsChecked="{Binding ElementName=LogsListView, Path=DataContext.UseRegularExpressions}">
                            <ToggleButton.Template>
                                <ControlTemplate>
                                    <Border x:Name="toggleBorder" BorderThickness="0" Height="33" BorderBrush="DeepSkyBlue">
                                        <Image Source="{StaticResource RegularExpressionsImage}" Margin="0"/>
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="ToggleButton.IsChecked" Value="True">
                                            <Setter Property="BorderThickness" TargetName="toggleBorder" Value="2"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </ToggleButton.Template>
                        </ToggleButton>
                    </StackPanel>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="contentTB" Property="Foreground" Value="Black"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ContextMenu x:Key="ItemContextMenu" Style="{StaticResource BaseContextMenu}">
        <MenuItem Header="Hide Messages from this Logger"  
                  FontSize="14" FontWeight="Bold"
                  Margin="0" 
                  Command="{Binding Path=DataContext.DontShowThisLoggerCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}}">
            <MenuItem.Icon>
                <Image Source="{StaticResource HiddenEyeImage}" Width="24" Height="24" Margin="4"/>
            </MenuItem.Icon>
        </MenuItem>

        <MenuItem Header="Don't Receive this Logger" 
                  FontSize="14" FontWeight="Bold"
                  ToolTip="Don't add new messages to buffer from this Logger" Margin="0" 
                  Command="{Binding Path=DataContext.DontReceiveThisLoggerCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}}" >
            <MenuItem.Icon>
                <Image Source="{StaticResource StopImage}" Width="24" Height="24" Margin="4"/>
            </MenuItem.Icon>
        </MenuItem>

        <Separator />

        <MenuItem Header="Set Time Interval" InputGestureText="Ctrl+Shift+T" 
                  FontSize="14" FontWeight="Bold"
                  Margin="0" 
                  Command="{Binding Path=DataContext.SetTimeIntervalCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}}" >
            <MenuItem.Icon>
                <Image Source="{StaticResource GoToTimestampDrawingImage}" Width="24" Height="24" Margin="4"/>
            </MenuItem.Icon>
        </MenuItem>

        <MenuItem Header="Go to Timestamp" InputGestureText="Ctrl+T" 
                  Margin="0"
                  FontSize="14" FontWeight="Bold"
                  Command="{Binding Path=DataContext.GoToTimestampCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}}" >
            <MenuItem.Icon>
                <Image Source="{StaticResource GoToTimestampDrawingImage}" Width="24" Height="24" Margin="4"/>
            </MenuItem.Icon>
        </MenuItem>

        <MenuItem Header="Go to Next Warning" 
                  InputGestureText="Ctrl+W" 
                  Margin="0" 
                  FontSize="14" FontWeight="Bold"
                  Command="{Binding Path=DataContext.FindNextWarningCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}}" >
            <MenuItem.Icon>
                <Image Source="{StaticResource FindNextWarning}" Width="24" Height="24" Margin="4"/>
            </MenuItem.Icon>
        </MenuItem>

        <MenuItem Header="Go to Next Error" 
                  InputGestureText="Ctrl+E" 
                  Margin="0" 
                  FontSize="14" FontWeight="Bold"
                  Command="{Binding Path=DataContext.FindNextErrorCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}}" >
            <MenuItem.Icon>
                <Image Source="{StaticResource FindNextError}" Width="24" Height="24" Margin="4"/>
            </MenuItem.Icon>
        </MenuItem>

        <MenuItem Header="Find in Tree" Margin="0" 
                  FontSize="14" FontWeight="Bold"
                  Command="{Binding Path=DataContext.FindInTreeCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}}">
            <MenuItem.Icon>
                <Image Source="{StaticResource TreeImage}" Width="24" Height="24" Margin="4"/>
            </MenuItem.Icon>
        </MenuItem>
    </ContextMenu>

    <Style x:Key="LogItemStyle" TargetType="{x:Type ListViewItem}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding Level}" Value="Warn">
                <Setter Property="Foreground" Value="Orange"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Level}" Value="Error">
                <Setter Property="Foreground" Value="Red"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Level}" Value="Fatal">
                <Setter Property="Foreground" Value="Red"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Level}" Value="Info">
                <Setter Property="Foreground" Value="Blue"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Level}" Value="Debug">
                <Setter Property="Foreground" Value="Green"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Level}" Value="Trace">
                <Setter Property="Foreground" Value="DarkMagenta"/>
            </DataTrigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.5"/>
            </Trigger>
        </Style.Triggers>

        <Setter Property="ContextMenu" Value="{StaticResource ItemContextMenu}" />
        <Setter Property="Background" Value="{Binding Path=ToggleMark}"/>
        <Setter Property="Margin" Value="0,-1,0,-1"/>
        <Setter Property="HorizontalAlignment" Value="Stretch" />
    </Style>

    <Style x:Key="SearchLogItemStyle" TargetType="{x:Type ListViewItem}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding Level}" Value="Warn">
                <Setter Property="Foreground" Value="Orange"></Setter>
            </DataTrigger>
            <DataTrigger Binding="{Binding Level}" Value="Error">
                <Setter Property="Foreground" Value="Red"></Setter>
            </DataTrigger>
            <DataTrigger Binding="{Binding Level}" Value="Fatal">
                <Setter Property="Foreground" Value="DarkRed"></Setter>
            </DataTrigger>
            <DataTrigger Binding="{Binding Level}" Value="Info">
                <Setter Property="Foreground" Value="Black"></Setter>
            </DataTrigger>
            <DataTrigger Binding="{Binding Level}" Value="Debug">
                <Setter Property="Foreground" Value="Green"></Setter>
            </DataTrigger>
            <DataTrigger Binding="{Binding Level}" Value="Trace">
                <Setter Property="Foreground" Value="Blue"></Setter>
            </DataTrigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.5"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type ContextMenu}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContextMenu}">
                    <Border x:Name="Border"
                            Background="#F4F4F4"
                            BorderThickness="1"
                            CornerRadius="4" Width="160">
                        <Border.BorderBrush>
                            <SolidColorBrush Color="DimGray" />
                        </Border.BorderBrush>
                        <StackPanel IsItemsHost="True"
                                    KeyboardNavigation.DirectionalNavigation="Cycle" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <converters:TreeViewLineConverter x:Key="LineConverter"/>
    <SolidColorBrush x:Key="GlyphBrush" Color="#444" />

    <!-- Toggle Button -->
    <Style x:Key="ExpandCollapseToggleStyle" TargetType="ToggleButton">
        <Setter Property="Focusable" Value="False"/>
        <!--<Setter Property="Command" Value="{Binding Path=DataContext.ExpandTreeViewClickCommand, RelativeSource={RelativeSource AncestorType={x:Type mah:MetroContentControl}}}"></Setter>-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid Width="15" Height="13" SnapsToDevicePixels="True">
                        <Rectangle Width="9" Height="9" Stroke="#919191" SnapsToDevicePixels="true">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.5,2" StartPoint="0.5,0">
                                    <GradientStop Color="White" Offset="0"/>
                                    <GradientStop Color="Silver" Offset="0.5"/>
                                    <GradientStop Color="LightGray" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle x:Name="ExpandPath" Width="1" Height="5" Stroke="Black" SnapsToDevicePixels="true"/>
                        <Rectangle Width="5" Height="1" Stroke="Black" SnapsToDevicePixels="true"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Visibility"  TargetName="ExpandPath" Value="Collapsed"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- TreeViewItem -->
    <Style x:Key="{x:Type TreeViewItem}" TargetType="{x:Type TreeViewItem}">
        <Setter Property="IsExpanded" Value="{Binding Path=IsExpanded, Mode=TwoWay}"/>
        <Setter Property="Visibility" Value="{Binding Path=IsVisible, Mode=TwoWay, Converter={StaticResource BooleanToVisibility}}"/>
        <Setter Property="helpers:TVIExtender.UseExtender" Value="True"/>
        <!--<Setter Property="Background" Value="Transparent"/>-->
        <Setter Property="Padding" Value="1,0,0,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TreeViewItem}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition MinWidth="19" Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>

                        <!-- Connecting Lines -->
                        <!-- Connecting Lines -->
                        <Border x:Name="HorLn" Margin="9,0,0,0" HorizontalAlignment="Stretch" Height="1" BorderThickness="0,0,0,1">
                            <Border.BorderBrush>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="2,0" SpreadMethod="Repeat" MappingMode="Absolute">
                                    <GradientStop Color="Transparent" Offset="0" />
                                    <GradientStop Color="Transparent" Offset="0.499" />
                                    <GradientStop Color="#999" Offset="0.5" />
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                        </Border>
                        <Border x:Name="VerLn" Margin="0,0,1,0" Grid.RowSpan="2" VerticalAlignment="Stretch" Width="1" BorderThickness="0,0,1,0">
                            <Border.BorderBrush>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="0,2" SpreadMethod="Repeat" MappingMode="Absolute">
                                    <GradientStop Color="Transparent" Offset="0" />
                                    <GradientStop Color="Transparent" Offset="0.499" />
                                    <GradientStop Color="#999" Offset="0.5" />
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                        </Border>
                        
                        <ToggleButton Margin="-1,0,0,0" x:Name="Expander" 
                                      Style="{StaticResource ExpandCollapseToggleStyle}" 
                                      IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" 
                                      ClickMode="Press"/>
                        
                        <Border Name="Bd" Grid.Column="1" 
                                Background="{TemplateBinding Background}" 
                                BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
                            <ContentPresenter x:Name="PART_Header" 
                                              ContentSource="Header" 
                                              MinWidth="20"/>
                        </Border>
                        <ItemsPresenter x:Name="ItemsHost" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <!-- This trigger changes the connecting lines if the item is the last in the list -->
                        <Trigger Property="helpers:TVIExtender.IsLastOne" Value="True">
                            <Setter TargetName="VerLn" Property="Height" Value="9"/>
                            <Setter TargetName="VerLn" Property="VerticalAlignment" Value="Top"/>
                        </Trigger>

                        <Trigger Property="IsExpanded" Value="false">
                            <Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="HasItems" Value="false">
                            <Setter TargetName="Expander" Property="Visibility" Value="Hidden"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="HasHeader" Value="false"/>
                                <Condition Property="Width" Value="Auto"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="PART_Header" Property="MinWidth" Value="75"/>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="HasHeader" Value="false"/>
                                <Condition Property="Height" Value="Auto"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="PART_Header" Property="MinHeight" Value="19"/>
                        </MultiTrigger>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true"/>
                                <Condition Property="IsSelectionActive" Value="false"/>
                            </MultiTrigger.Conditions>
                        </MultiTrigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                        <!--<DataTrigger Binding="{Binding Path=IsSelected}" Value="True">
                            <Setter Property="Background" Value="#ADD8E6"/>
                        </DataTrigger>-->
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Settings Styles -->

    <Style x:Key="IPTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource MahApps.Styles.TextBox}">
        <Setter Property="Width" Value="220"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="TextAlignment" Value="Center"/>
        <Setter Property="FontSize" Value="16"/>

    </Style>

    <Style TargetType="{x:Type Border}">
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="BorderBrush" Value="Gray"/>
        <Setter Property="CornerRadius" Value="3"/>
    </Style>

    <Style x:Key="RemoveButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource MahApps.Styles.Button}">
        <Setter Property="FontSize" Value="16"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding SelectedReceiver}" Value="{x:Null}">
                <Setter Property="IsEnabled" Value="False"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="AddButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource MahApps.Styles.Button}">
        <Setter Property="FontSize" Value="16"/>
    </Style>

    <Style x:Key="RemoveIgnoreIpButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource MahApps.Styles.Button.MetroSquare.Accent}">
        <Setter Property="Width" Value="100"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="Content" Value="Remove"/>
        <Setter Property="Margin" Value="120,0,0,0"/>
        <Setter Property="Command" Value="{Binding Path=RemoveIgnoreIPCommand}"/>

        <Style.Triggers>
            <DataTrigger Binding="{Binding SelectedIP}" Value="{x:Null}">
                <Setter Property="IsEnabled" Value="False"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="AddIgnoreIpButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource MahApps.Styles.Button.MetroSquare.Accent}">
        <Setter Property="Width" Value="100"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="Content" Value="Add"/>
        <Setter Property="Margin" Value="0,0,120,0"/>
        <Setter Property="Command" Value="{Binding Path=AddIgnoreIPCommand}"/>

        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Path=(Validation.HasError), ElementName=IPAddress}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="IsEnabled" Value="False"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="SetDefaultButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource CircleImageButtonStyle}">
        <Setter Property="ToolTip" Value="Set Default"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="Margin" Value="10,0"/>
        <Setter Property="Width" Value="25"/>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="True">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                                <Image Source="{StaticResource ReturnBackImage}" Cursor="Hand"/>
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property ="IsPressed" Value ="True">
                                    <Setter TargetName="RootGrid" Property="RenderTransform">
                                        <Setter.Value>
                                            <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="ExportButtonStyleCircle" TargetType="{x:Type Button}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
        <Setter Property="ToolTip" Value="Export Logs"/>
        <Setter Property="Height" Value="26"/>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="True">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                                <Image Source="{StaticResource LeftImage}" Cursor="Hand"/>
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property ="IsPressed" Value ="True">
                                    <Setter TargetName="RootGrid" Property="RenderTransform">
                                        <Setter.Value>
                                            <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="ImportButtonStyleCircle" 
           TargetType="{x:Type Button}" BasedOn="{StaticResource MahApps.Styles.Button.Circle}">
        <Setter Property="Margin" Value="5,0"/>
        <Setter Property="ToolTip" Value="Import Logs"/>
        <Setter Property="Height" Value="26"/>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="True">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid RenderTransformOrigin="0.5,0.5" x:Name="RootGrid">
                                <Image Source="{StaticResource RightImage}" Cursor="Hand"/>
                                <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <Trigger Property ="IsPressed" Value ="True">
                                    <Setter TargetName="RootGrid" Property="RenderTransform">
                                        <Setter.Value>
                                            <ScaleTransform ScaleX="0.95" ScaleY="0.95"/>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>