	  
	   
    
		

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1tb="clr-namespace:C1.WPF.Toolbar" xmlns:c1="clr-namespace:C1.WPF;assembly=C1.WPF.4" xmlns:system="clr-namespace:System;assembly=mscorlib">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/C1.WPF.4;component/themes/Common.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <CornerRadius x:Key="PopupCornerRadius">2</CornerRadius>
    <Thickness x:Key="ToolbarButtonPadding">4</Thickness>
    <c1tb:C1ToolbarCommandConverter x:Key="commandConverter" />

    <!-- C1ToolbarSplitButton -->
    <Style TargetType="c1tb:C1ToolbarSplitButton">
        <Setter Property="AutoClose" Value="True" />
        <Setter Property="Padding" Value="{StaticResource ToolbarButtonPadding}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="c1tb:C1ToolbarSplitButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="DropDownOpenStates">
                                <VisualState x:Name="Closed" />
                                <VisualState x:Name="Opened" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver" />
                            </VisualStateGroup>

                            <VisualStateGroup x:Name="ToolbarStates">
                                <VisualState x:Name="Medium" />
                                <VisualState x:Name="Large">
                                    <Storyboard>
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LargeView" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MediumView" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SmallView" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTemplate" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTemplate" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Small">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LargeView" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="MediumView" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SmallView" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTemplate" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTemplate" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>

                        </VisualStateManager.VisualStateGroups>
                        <Grid Margin="{TemplateBinding BorderThickness}">
                            <Grid>
                                <c1tb:C1ToolbarToggleButton x:Name="ArrowToggle" IsEnabled="{TemplateBinding IsEnabled}" IsTabStop="{TemplateBinding IsTabStop}" BorderThickness="0" Background="{TemplateBinding Background}" Padding="0" Foreground="{TemplateBinding HeaderForeground}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}">

                  <Grid Background="{TemplateBinding HeaderBackground}">
                                        <Grid x:Name="HorizontalTemplate">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition />
                                                <ColumnDefinition Width="10" />
                                            </Grid.ColumnDefinitions>
                                            <Border Background="Transparent" Grid.Column="1" />
                                            <c1tb:C1ToolbarButton x:Name="HeaderButton" Background="{TemplateBinding Background}" MouseOverBrush="{TemplateBinding MouseOverBrush}" PressedBrush="{TemplateBinding PressedBrush}">
                                                <Grid>

                                                    <StackPanel x:Name="MediumView" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource commandConverter}}" Margin="{TemplateBinding Padding}" Orientation="Horizontal">
                                                        <Image x:Name="img2" Stretch="None" Source="{Binding SmallImageSource}" />
                                                        <TextBlock x:Name="MediumText" Text="{Binding LabelTitle}" VerticalAlignment="Center" />
                                                    </StackPanel>
                                                    <StackPanel x:Name="SmallView" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource commandConverter}}" Margin="{TemplateBinding Padding}" Orientation="Horizontal" Visibility="Collapsed">
                                                        <Image x:Name="img3" Stretch="None" Source="{Binding SmallImageSource}" />
                                                    </StackPanel>

                                                    <ContentPresenter x:Name="HeaderPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Margin="{TemplateBinding HeaderPadding}" VerticalAlignment="{TemplateBinding VerticalHeaderAlignment}" HorizontalAlignment="{TemplateBinding HorizontalHeaderAlignment}" />

                                                </Grid>

                                            </c1tb:C1ToolbarButton>
                                            <Polygon x:Name="ArrowPolygon" Grid.Column="1" Stretch="Uniform" Points="0,0 2,0 1,1" Width="7" Margin="0 1 1 1" Fill="{TemplateBinding HeaderForeground}" StrokeThickness="1" />
                                        </Grid>

                                        <Grid x:Name="VerticalTemplate" Visibility="Collapsed">
                                            <Grid.RowDefinitions>
                                                <RowDefinition />
                                                <RowDefinition Height="10" />
                                            </Grid.RowDefinitions>
                                            <Border Background="Transparent" Grid.Row="1" />
                                            <c1tb:C1ToolbarButton x:Name="HeaderButtonV">

                                                <StackPanel x:Name="LargeView" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource commandConverter}}" Margin="{TemplateBinding Padding}">
                                                    <Image x:Name="img1" Stretch="None" Source="{Binding LargeImageSource}" />
                                                    <TextBlock x:Name="LargeText" Text="{Binding LabelTitle}" TextAlignment="Center" />
                                                </StackPanel>

                                            </c1tb:C1ToolbarButton>
                                            <Polygon x:Name="ArrowPolygonV" Grid.Row="1" HorizontalAlignment="Center" Stretch="Uniform" Points="0,0 2,0 1,1" Width="7" Margin="1 0 1 1" Fill="{TemplateBinding Foreground}" StrokeThickness="1" />
                                        </Grid>
                                    </Grid>
                                </c1tb:C1ToolbarToggleButton>
                            </Grid>
                            <Popup x:Name="DropDownPopup">
                                <Border Background="{TemplateBinding ContentBackground}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{StaticResource GeneralThickness}" CornerRadius="{StaticResource PopupCornerRadius}" Height="{TemplateBinding DropDownHeight}" Width="{TemplateBinding DropDownWidth}">
                                    <ContentPresenter />
                                </Border>
                            </Popup>
                            <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" IsHitTestVisible="False" Opacity="0" Visibility="{TemplateBinding DisabledCuesVisibility}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
