<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:r="clr-namespace:Eto.Wpf.CustomControls.TreeGridView"
    xmlns:efc="clr-namespace:Eto.Wpf.Forms.Controls"
    xmlns:e="clr-namespace:Eto.Wpf"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
    xmlns:themes="clr-namespace:Xceed.Wpf.Toolkit.Themes;assembly=Xceed.Wpf.Toolkit"
    xmlns:local="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit">

    <SolidColorBrush x:Key="ToggleButton.Checked.Background" Color="#FFBBDDEE"/>
    <SolidColorBrush x:Key="ToggleButton.Checked.Border" Color="#FF255A83"/>
    <SolidColorBrush x:Key="ToggleButton.Static.Background" Color="#FFDDDDDD"/>
    <SolidColorBrush x:Key="ToggleButton.Static.Border" Color="#FF707070"/>
    <SolidColorBrush x:Key="ToggleButton.MouseOver.Background" Color="#FFBEE6FD"/>
    <SolidColorBrush x:Key="ToggleButton.MouseOver.Border" Color="#FF3C7FB1"/>
    <SolidColorBrush x:Key="ToggleButton.Pressed.Background" Color="#FFC4E5F6"/>
    <SolidColorBrush x:Key="ToggleButton.Pressed.Border" Color="#FF2C628B"/>
    <SolidColorBrush x:Key="ToggleButton.Disabled.Background" Color="#FFF4F4F4"/>
    <SolidColorBrush x:Key="ToggleButton.Disabled.Border" Color="#FFADB2B5"/>
    <SolidColorBrush x:Key="ToggleButton.Disabled.Foreground" Color="#FF838383"/>

    <Style TargetType="efc:EtoToggleButton">
        <Setter Property="Padding" Value="2" />
        <Style.Triggers>
            <Trigger Property="e:WpfProperties.EtoStyle" Value="SegmentedButton">
                <Setter Property="Padding" Value="4,2" />

                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ToggleButton">
                            <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true" Margin="-1,0,0,0">
                                <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                            <ControlTemplate.Triggers>

                                <Trigger Property="e:WpfProperties.EtoModifier" Value="first">
                                    <Setter TargetName="border" Property="Margin" Value="0" />
                                    <Setter TargetName="border" Property="CornerRadius" Value="4,0,0,4" />
                                </Trigger>
                                <Trigger Property="e:WpfProperties.EtoModifier" Value="last">
                                    <Setter TargetName="border" Property="CornerRadius" Value="0,4,4,0" />
                                </Trigger>

                                <Trigger Property="IsChecked" Value="True">
                                    <Setter Property="Background" TargetName="border" Value="{DynamicResource ToggleButton.Checked.Background}"/>
                                    <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource ToggleButton.Checked.Border}"/>
                                    <Setter Property="Panel.ZIndex" Value="900" />
                                </Trigger>


                                <!-- Defaults -->
                                <Trigger Property="Button.IsDefaulted" Value="true">
                                    <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" TargetName="border" Value="{StaticResource ToggleButton.MouseOver.Background}"/>
                                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ToggleButton.MouseOver.Border}"/>
                                    <Setter Property="Panel.ZIndex" Value="999" />
                                </Trigger>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="Background" TargetName="border" Value="{StaticResource ToggleButton.Pressed.Background}"/>
                                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ToggleButton.Pressed.Border}"/>
                                    <Setter Property="Panel.ZIndex" Value="999" />
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Background" TargetName="border" Value="{StaticResource ToggleButton.Disabled.Background}"/>
                                    <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource ToggleButton.Disabled.Border}"/>
                                    <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource ToggleButton.Disabled.Foreground}"/>
                                </Trigger>

                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>


</ResourceDictionary>