<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"                    
                    xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"
                    xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
    </ResourceDictionary.MergedDictionaries>
    
	<converters:TextFieldHintVisibilityConverter x:Key="TextFieldHintVisibilityConverter" />

	<Style x:Key="FocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle Margin="2 2 2 2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="MaterialDesignComboBoxItemStyle" TargetType="{x:Type ComboBoxItem}">
		<Setter Property="SnapsToDevicePixels" Value="True"/>
		<Setter Property="Padding" Value="8"/>
		<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="BorderThickness" Value="0"/>
		<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>        
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ComboBoxItem}">
					<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
						<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Property="Opacity" TargetName="Bd" Value="0.56"/>
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="False"/>
								<Condition Property="IsMouseOver" Value="True"/>
								<Condition Property="IsKeyboardFocused" Value="False"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource MaterialDesignDivider}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="True"/>
								<Condition Property="IsMouseOver" Value="False"/>
								<Condition Property="IsKeyboardFocused" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource MaterialDesignSelection}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="True"/>
								<Condition Property="IsMouseOver" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource MaterialDesignSelection}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="True"/>
								<Condition Property="IsMouseOver" Value="False"/>
								<Condition Property="IsKeyboardFocused" Value="False"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource MaterialDesignSelection}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="False"/>
								<Condition Property="IsMouseOver" Value="False"/>
								<Condition Property="IsKeyboardFocused" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource MaterialDesignDivider}"/>
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="False"/>
								<Condition Property="IsMouseOver" Value="True"/>
								<Condition Property="IsKeyboardFocused" Value="True"/>
							</MultiTrigger.Conditions>
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource MaterialDesignDivider}"/>
						</MultiTrigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
    <Style x:Key="MaterialDesignComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
		<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/>
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="IsTabStop" Value="false"/>
		<Setter Property="Focusable" Value="false"/>
		<Setter Property="ClickMode" Value="Press"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border x:Name="templateRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"                                     
                                        SnapsToDevicePixels="true">
						<Border x:Name="splitBorder" BorderBrush="Transparent" BorderThickness="0" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Top"  SnapsToDevicePixels="true">
							<Viewbox Width="Auto" Height="24">
								<Canvas Width="24" Height="24">
									<Path x:Name="arrow" Data="M7,10L12,15L17,10H7Z" Fill="{TemplateBinding BorderBrush}" HorizontalAlignment="Right" Margin="0" VerticalAlignment="Center" Canvas.Left="7" SnapsToDevicePixels="True"/>
								</Canvas>
							</Viewbox>
						</Border>
					</Border>
					<ControlTemplate.Triggers>
						<MultiDataTrigger>
							<MultiDataTrigger.Conditions>
								<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
								<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
							</MultiDataTrigger.Conditions>
						</MultiDataTrigger>
						<MultiDataTrigger>
							<MultiDataTrigger.Conditions>
								<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
								<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
							</MultiDataTrigger.Conditions>
							<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/>
						</MultiDataTrigger>
						<Trigger Property="IsPressed" Value="true">
							<Setter Property="Fill" TargetName="arrow" Value="{DynamicResource PrimaryHueDarkBrush}"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Fill" TargetName="arrow" Value="{DynamicResource MaterialDesignCheckBoxDisabled}"/>
						</Trigger>
						<MultiDataTrigger>
							<MultiDataTrigger.Conditions>
								<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
								<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false"/>
							</MultiDataTrigger.Conditions>
							<Setter Property="BorderBrush" TargetName="templateRoot" Value="{DynamicResource MaterialDesignCheckBoxDisabled}"/>
						</MultiDataTrigger>
						<MultiDataTrigger>
							<MultiDataTrigger.Conditions>
								<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
								<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
							</MultiDataTrigger.Conditions>
							<Setter Property="BorderBrush" TargetName="templateRoot" Value="{DynamicResource MaterialDesignCheckBoxDisabled}"/>
							<Setter Property="BorderBrush" TargetName="splitBorder" Value="{DynamicResource MaterialDesignCheckBoxDisabled}"/>
						</MultiDataTrigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
    
    <ControlTemplate x:Key="MaterialDesignComboBoxTemplate" TargetType="{x:Type ComboBox}">
        <Grid x:Name="templateRoot" SnapsToDevicePixels="true" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
            </Grid.ColumnDefinitions>
            <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
                <Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2"
                                    MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
                                    BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}" Effect="{StaticResource MaterialDesignShadowDepth2}">
                    <Border x:Name="dropDownBorder" Background="Transparent">
                        <ScrollViewer x:Name="DropDownScrollViewer">
                            <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
                                <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
                                    <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
                                </Canvas>
                                <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                                        />
                            </Grid>
                        </ScrollViewer>
                    </Border>
                </Border>
            </Popup>
            <ToggleButton x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource MaterialDesignComboBoxToggleButton}"
                                  />
            <TextBlock x:Name="Hint"
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Opacity="{Binding Path=(wpf:TextFieldAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
                            IsHitTestVisible="False"                       
                            Text="{TemplateBinding wpf:TextFieldAssist.Hint}"
                            Visibility="{TemplateBinding Text, Converter={StaticResource TextFieldHintVisibilityConverter}}" />
            <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Content="{TemplateBinding SelectionBoxItem}" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            <Border BorderBrush="{DynamicResource PrimaryHueMidBrush}" BorderThickness="0 0 0 2"
                            x:Name="focusBorder" Visibility="Hidden"
                            Grid.ColumnSpan="2" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
                <Setter Property="Margin" TargetName="shadow" Value="5,5,5,5"/>
            </Trigger>
            <Trigger Property="HasItems" Value="false">
                <Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True">
                <Setter TargetName="focusBorder" Property="Visibility" Value="Visible" />
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsGrouping" Value="true"/>
                    <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
                </MultiTrigger.Conditions>
                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
            </MultiTrigger>
            <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
                <Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
                <Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="MaterialDesignFloatingHintComboBoxTemplate" TargetType="{x:Type ComboBox}">
        <ControlTemplate.Resources>
            <Storyboard x:Key="MoveHintAsideStoryboard">
                <DoubleAnimation Storyboard.TargetProperty="FontSize" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3" To="10">
                    <DoubleAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3" To="1">
                    <DoubleAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <ThicknessAnimation Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3" To="1,-14,1,0">
                    <ThicknessAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </ThicknessAnimation.EasingFunction>
                </ThicknessAnimation>
            </Storyboard>
            <Storyboard x:Key="MoveHintBackStoryboard">
                <DoubleAnimation Storyboard.TargetProperty="FontSize" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3">
                    <DoubleAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3">
                    <DoubleAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <ThicknessAnimation Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3">
                    <ThicknessAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </ThicknessAnimation.EasingFunction>
                </ThicknessAnimation>
            </Storyboard>
        </ControlTemplate.Resources>
        <Grid x:Name="templateRoot" SnapsToDevicePixels="true"  VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
            <Grid Margin="0 14 0 0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
                </Grid.ColumnDefinitions>
                <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
                    <Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2"
                                        MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
                                        BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}" Effect="{StaticResource MaterialDesignShadowDepth2}">
                        <Border x:Name="dropDownBorder" Background="Transparent">
                            <ScrollViewer x:Name="DropDownScrollViewer">
                                <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
                                    <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
                                        <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
                                    </Canvas>
                                    <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                                            />
                                </Grid>
                            </ScrollViewer>
                        </Border>
                    </Border>
                </Popup>
                <ToggleButton x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource MaterialDesignComboBoxToggleButton}"
                                      />
                <TextBlock x:Name="Hint"
                           Margin="{TemplateBinding Padding}"
                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"                       
                           Opacity="{Binding Path=(wpf:TextFieldAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
                           IsHitTestVisible="False"                       
                           Text="{TemplateBinding wpf:TextFieldAssist.Hint}" />
                <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Content="{TemplateBinding SelectionBoxItem}" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsHitTestVisible="false" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                <Border BorderBrush="{DynamicResource PrimaryHueMidBrush}" BorderThickness="0 0 0 2"
                        x:Name="focusBorder" Visibility="Hidden"
                        Grid.ColumnSpan="2" />
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="wpf:TextFieldAssist.IsNullOrEmpty" Value="False">
                <Trigger.EnterActions>
                    <BeginStoryboard x:Name="MoveHintAsideStoryboard_BeginStoryboard" Storyboard="{StaticResource MoveHintAsideStoryboard}"/>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard x:Name="MoveHintBackStoryboard_BeginStoryboard" Storyboard="{StaticResource MoveHintBackStoryboard}"/>
                </Trigger.ExitActions>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="wpf:TextFieldAssist.IsNullOrEmpty" Value="False" />
                    <Condition Property="IsKeyboardFocused" Value="True" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
            </MultiTrigger>
            <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
                <Setter Property="Margin" TargetName="shadow" Value="5,5,5,5"/>
            </Trigger>
            <Trigger Property="HasItems" Value="false">
                <Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True">
                <Setter TargetName="focusBorder" Property="Visibility" Value="Visible" />
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsGrouping" Value="true"/>
                    <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
                </MultiTrigger.Conditions>
                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
            </MultiTrigger>
            <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
                <Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
                <Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="MaterialDesignComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
		<Setter Property="OverridesDefaultStyle" Value="true"/>
		<Setter Property="AllowDrop" Value="true"/>
		<Setter Property="MinWidth" Value="0"/>
		<Setter Property="MinHeight" Value="0"/>
		<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
		<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
		<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
		<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="1 0 1 0" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TextBox}">
					<Grid>
                        <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
											  />
                    </Grid>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

    <ControlTemplate x:Key="MaterialDesignComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
        <Grid x:Name="templateRoot" SnapsToDevicePixels="true"  VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
			</Grid.ColumnDefinitions>
			<Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
				<Border x:Name="dropDownBorder" BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="1" Background="{DynamicResource MaterialDesignPaper}"
                                CornerRadius="2"
                                MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" Effect="{StaticResource MaterialDesignShadowDepth2}">
					<ScrollViewer x:Name="DropDownScrollViewer">
						<Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
							<Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
								<Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
							</Canvas>
							<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
						</Grid>
					</ScrollViewer>
				</Border>
			</Popup>
			<ToggleButton x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource MaterialDesignComboBoxToggleButton}"/>
			<Border x:Name="border" Background="Transparent" Margin="{TemplateBinding BorderThickness}">
                <Grid>
                    <TextBlock x:Name="Hint"
                            Margin="{TemplateBinding Padding}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Opacity="{Binding Path=(wpf:TextFieldAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
                            Text="{TemplateBinding wpf:TextFieldAssist.Hint}"
                            IsHitTestVisible="False"
                            Visibility="{TemplateBinding Text, Converter={StaticResource TextFieldHintVisibilityConverter}}" />
				    <TextBox x:Name="PART_EditableTextBox" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}" Style="{StaticResource MaterialDesignComboBoxEditableTextBox}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </Grid>
			</Border>
			<Border BorderBrush="{DynamicResource PrimaryHueMidBrush}" BorderThickness="0 0 0 2"
                            x:Name="focusBorder" Visibility="Hidden"
                            Grid.ColumnSpan="2" />
		</Grid>
		<ControlTemplate.Triggers>
			<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
				<Setter Property="Margin" TargetName="dropDownBorder" Value="5,5,5,5"/>
			</Trigger>
			<Trigger Property="IsEnabled" Value="false">
				<Setter Property="Opacity" TargetName="border" Value="0.56"/>
			</Trigger>
			<Trigger Property="HasItems" Value="false">
				<Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
			</Trigger>
			<Trigger Property="IsKeyboardFocused" Value="True" SourceName="PART_EditableTextBox">
				<Setter TargetName="focusBorder" Property="Visibility" Value="Visible" />
			</Trigger>
			<MultiTrigger>
				<MultiTrigger.Conditions>
					<Condition Property="IsGrouping" Value="true"/>
					<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
				</MultiTrigger.Conditions>
				<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
			</MultiTrigger>
			<Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
				<Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
				<Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
			</Trigger>
		</ControlTemplate.Triggers>
	</ControlTemplate>

    <ControlTemplate x:Key="MaterialDesignFloatingHintComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
        <ControlTemplate.Resources>
            <Storyboard x:Key="MoveHintAsideStoryboard">
                <DoubleAnimation Storyboard.TargetProperty="FontSize" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3" To="10">
                    <DoubleAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3" To="1">
                    <DoubleAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <ThicknessAnimation Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3" To="1,-14,1,0">
                    <ThicknessAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </ThicknessAnimation.EasingFunction>
                </ThicknessAnimation>
            </Storyboard>
            <Storyboard x:Key="MoveHintBackStoryboard">
                <DoubleAnimation Storyboard.TargetProperty="FontSize" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3">
                    <DoubleAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3">
                    <DoubleAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </DoubleAnimation.EasingFunction>
                </DoubleAnimation>
                <ThicknessAnimation Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="Hint"
                                             Duration="0:0:0.3">
                    <ThicknessAnimation.EasingFunction>
                        <SineEase EasingMode="EaseOut" />
                    </ThicknessAnimation.EasingFunction>
                </ThicknessAnimation>
            </Storyboard>
        </ControlTemplate.Resources>
        <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0"/>
            </Grid.ColumnDefinitions>
            <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
                <Border x:Name="dropDownBorder" BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="1" Background="{DynamicResource MaterialDesignPaper}"
                                CornerRadius="2"
                                MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" Effect="{StaticResource MaterialDesignShadowDepth2}">
                    <ScrollViewer x:Name="DropDownScrollViewer">
                        <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
                            <Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
                                <Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
                            </Canvas>
                            <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                        </Grid>
                    </ScrollViewer>
                </Border>
            </Popup>
            <ToggleButton x:Name="toggleButton" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource MaterialDesignComboBoxToggleButton}"
                          Margin="0 14 0 0"/>
            <Border x:Name="border" Background="Transparent" Margin="{TemplateBinding BorderThickness}">
                <Grid Margin="0 14 0 0">
                    <TextBlock x:Name="Hint"
                               FontSize="{TemplateBinding FontSize}"
                               Margin="{TemplateBinding Padding}"
                               HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                               VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                               Opacity="{Binding Path=(wpf:TextFieldAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}"
                               Text="{TemplateBinding wpf:TextFieldAssist.Hint}"
                               IsHitTestVisible="False" />
                    <TextBox x:Name="PART_EditableTextBox" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}" Style="{StaticResource MaterialDesignComboBoxEditableTextBox}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                </Grid>
            </Border>
            <Border BorderBrush="{DynamicResource PrimaryHueMidBrush}" BorderThickness="0 0 0 2"
                            x:Name="focusBorder" Visibility="Hidden"
                            Grid.ColumnSpan="2" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="wpf:TextFieldAssist.IsNullOrEmpty" Value="False">
                <Trigger.EnterActions>
                    <BeginStoryboard x:Name="MoveHintAsideStoryboard_BeginStoryboard" Storyboard="{StaticResource MoveHintAsideStoryboard}"/>
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard x:Name="MoveHintBackStoryboard_BeginStoryboard" Storyboard="{StaticResource MoveHintBackStoryboard}"/>
                </Trigger.ExitActions>
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="wpf:TextFieldAssist.IsNullOrEmpty" Value="False" />
                    <Condition Property="IsKeyboardFocused" Value="True" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
            </MultiTrigger>
            <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
                <Setter Property="Margin" TargetName="dropDownBorder" Value="5,5,5,5"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Opacity" TargetName="border" Value="0.56"/>
            </Trigger>
            <Trigger Property="HasItems" Value="false">
                <Setter Property="Height" TargetName="dropDownBorder" Value="95"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="True" SourceName="PART_EditableTextBox">
                <Setter TargetName="focusBorder" Property="Visibility" Value="Visible" />
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsGrouping" Value="true"/>
                    <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
                </MultiTrigger.Conditions>
                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
            </MultiTrigger>
            <Trigger Property="ScrollViewer.CanContentScroll" SourceName="DropDownScrollViewer" Value="false">
                <Setter Property="Canvas.Top" TargetName="opaqueRect" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}"/>
                <Setter Property="Canvas.Left" TargetName="opaqueRect" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="MaterialDesignComboBox" TargetType="{x:Type ComboBox}">
        <!--Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/-->
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}"/>
        <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}"/>
        <Setter Property="BorderThickness" Value="0 0 0 1"/>
        <Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignComboBoxItemStyle}" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="Padding" Value="0 4 0 4"/>
        <Setter Property="VerticalContentAlignment" Value="Top"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
        <Setter Property="Template" Value="{StaticResource MaterialDesignComboBoxTemplate}"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
                <Setter Property="BorderBrush"  Value="{DynamicResource PrimaryHueMidBrush}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocusWithin" Value="true">
                <Setter Property="BorderBrush"  Value="{DynamicResource PrimaryHueMidBrush}"/>
            </Trigger>
            <Trigger Property="IsEditable" Value="true">
                <Setter Property="IsTabStop" Value="false"/>
                <Setter Property="Template" Value="{StaticResource MaterialDesignComboBoxEditableTemplate}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MaterialDesignFloatingHintComboBox" TargetType="{x:Type ComboBox}" BasedOn="{StaticResource MaterialDesignComboBox}">
        <Setter Property="Template" Value="{StaticResource MaterialDesignFloatingHintComboBoxTemplate}"/>
        <Setter Property="wpf:TextFieldAssist.Text" Value="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
                <Setter Property="BorderBrush"  Value="{DynamicResource PrimaryHueMidBrush}"/>
            </Trigger>
            <Trigger Property="IsKeyboardFocusWithin" Value="true">
                <Setter Property="BorderBrush"  Value="{DynamicResource PrimaryHueMidBrush}"/>
            </Trigger>
            <Trigger Property="IsEditable" Value="true">
                <Setter Property="IsTabStop" Value="false"/>
                <Setter Property="Template" Value="{StaticResource MaterialDesignFloatingHintComboBoxEditableTemplate}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>
