<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Behaviors="clr-namespace:MahApps.Metro.Behaviours"
                    xmlns:Controls="clr-namespace:MahApps.Metro.Controls"
                    xmlns:Converters="clr-namespace:MahApps.Metro.Converters">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Shared.xaml" />
        <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.Buttons.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

    <Converters:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
    <!--  obsolete  -->
    <Converters:StringToVisibilityConverter x:Key="StringToOppositeVisibilityConverter" OppositeStringValue="True" />

    <!--  obsolete  -->
    <Grid x:Key="RevealButtonIcon"
          Width="16"
          Height="16"
          x:Shared="False"
          Background="{DynamicResource BlackBrush}"
          Opacity="0.8">
        <Grid.OpacityMask>
            <VisualBrush>
                <VisualBrush.Visual>
                    <Canvas Width="42" Height="25.8461">
                        <Path Canvas.Left="17"
                              Canvas.Top="25.0769"
                              Data="F1 M 38,33.1538C 40.6765,33.1538 42.8462,35.3235 42.8462,38C 42.8462,40.6765 40.6765,42.8461 38,42.8461C 35.3235,42.8461 33.1539,40.6765 33.1539,38C 33.1539,35.3235 35.3236,33.1538 38,33.1538 Z M 38,25.0769C 49.3077,25.0769 59,33.1538 59,38C 59,42.8461 49.3077,50.9231 38,50.9231C 26.6923,50.9231 17,42.8461 17,38C 17,33.1538 26.6923,25.0769 38,25.0769 Z M 38,29.1154C 33.0932,29.1154 29.1154,33.0932 29.1154,38C 29.1154,42.9068 33.0932,46.8846 38,46.8846C 42.9068,46.8846 46.8846,42.9068 46.8846,38C 46.8846,33.0932 42.9068,29.1154 38,29.1154 Z "
                              Fill="Black"
                              Stretch="Fill" />
                    </Canvas>
                </VisualBrush.Visual>
            </VisualBrush>
        </Grid.OpacityMask>
    </Grid>

    <!--  Button Style for Win8MetroPasswordBox  -->
    <Style x:Key="RevealButtonStyle"
           BasedOn="{StaticResource ChromelessButtonStyle}"
           TargetType="{x:Type ButtonBase}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ButtonBase}">
                    <Grid Background="{TemplateBinding Background}">
                        <ContentPresenter x:Name="PART_ContentPresenter"
                                          Margin="{TemplateBinding Padding}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          RecognizesAccessKey="True"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="PART_ContentPresenter" Property="Opacity" Value="1" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="False">
                            <Setter TargetName="PART_ContentPresenter" Property="Opacity" Value=".5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  Material - Eye  -->
    <ContentControl x:Key="DefaultRevealButtonIcon"
                    Width="Auto"
                    Height="Auto"
                    Padding="2"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    x:Shared="False"
                    Content="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"
                    Style="{DynamicResource PathIconContentControlStyle}" />

    <Grid x:Key="DefaultCapsLockIcon"
          Width="16"
          Height="16"
          x:Shared="False"
          Background="{DynamicResource BlackBrush}"
          Opacity="0.8">
        <Grid.OpacityMask>
            <VisualBrush>
                <VisualBrush.Visual>
                    <Canvas Width="24" Height="24">
                        <Path Data="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z" Fill="Black" />
                    </Canvas>
                </VisualBrush.Visual>
            </VisualBrush>
        </Grid.OpacityMask>
    </Grid>

    <!--  PasswordBox Style  -->
    <Style x:Key="MetroPasswordBox" TargetType="{x:Type PasswordBox}">
        <Setter Property="Background" Value="{DynamicResource ControlBackgroundBrush}" />
        <Setter Property="Behaviors:StylizedBehaviors.Behaviors">
            <Setter.Value>
                <Behaviors:StylizedBehaviorCollection>
                    <Behaviors:PasswordBoxBindingBehavior />
                </Behaviors:StylizedBehaviorCollection>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="{DynamicResource TextBoxBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="CaretBrush" Value="{DynamicResource BlackBrush}" />
        <Setter Property="ContextMenu" Value="{DynamicResource TextBoxMetroContextMenu}" />
        <Setter Property="Controls:ControlsHelper.FocusBorderBrush" Value="{DynamicResource TextBoxFocusBorderBrush}" />
        <Setter Property="Controls:ControlsHelper.MouseOverBorderBrush" Value="{DynamicResource TextBoxMouseOverBorderBrush}" />
        <Setter Property="Controls:PasswordBoxHelper.CapsLockIcon" Value="{StaticResource DefaultCapsLockIcon}" />
        <Setter Property="Controls:TextBoxHelper.ButtonFontSize" Value="{DynamicResource ClearTextButtonFontSize}" />
        <Setter Property="Controls:TextBoxHelper.ButtonWidth" Value="22" />
        <Setter Property="Controls:TextBoxHelper.IsMonitoring" Value="True" />
        <Setter Property="FontFamily" Value="{DynamicResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{DynamicResource ContentFontSize}" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="MinHeight" Value="26" />
        <Setter Property="Padding" Value="0" />
        <Setter Property="SelectionBrush" Value="{DynamicResource HighlightBrush}" />
        <!--  change SnapsToDevicePixels to true to view a better border and validation error  -->
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="enterGotFocus">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             To=".2"
                                             Duration="0:0:0.2" />
                        </Storyboard>
                        <Storyboard x:Key="exitGotFocus">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             Duration="0:0:0.2" />
                        </Storyboard>

                        <Storyboard x:Key="enterHasText">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             From=".2"
                                             To="0"
                                             Duration="0:0:0.2" />
                        </Storyboard>
                        <Storyboard x:Key="exitHasText">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             Duration="0:0:0.2" />
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid>
                        <AdornerDecorator x:Name="PART_WaitingForDataEffectAdornerDecorator" Visibility="Collapsed">
                            <Border x:Name="PART_WaitingForDataEffectGrid"
                                    Background="{TemplateBinding Background}"
                                    BorderBrush="Transparent"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Effect="{DynamicResource WaitingForDataEffect}"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </AdornerDecorator>
                        <Border x:Name="Base"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        <Grid Margin="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Name="TextColumn" Width="*" />
                                <ColumnDefinition x:Name="CapsLockColumn" Width="Auto" />
                                <ColumnDefinition x:Name="ButtonColumn" Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition x:Name="ButtonRow" Height="*" />
                            </Grid.RowDefinitions>

                            <ScrollViewer x:Name="PART_ContentHost"
                                          Grid.Row="1"
                                          Grid.Column="0"
                                          Margin="2"
                                          VerticalAlignment="Stretch"
                                          Background="{x:Null}"
                                          BorderThickness="0"
                                          IsTabStop="False" />
                            <TextBlock x:Name="PART_Message"
                                       Grid.Row="1"
                                       Grid.Column="0"
                                       Margin="6 2 6 2"
                                       Padding="{TemplateBinding Padding}"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                       Foreground="{TemplateBinding Foreground}"
                                       Style="{DynamicResource MahApps.Metro.Styles.MetroWatermarkTextBlock}"
                                       Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                       TextAlignment="{TemplateBinding Controls:TextBoxHelper.WatermarkAlignment}"
                                       TextTrimming="{TemplateBinding Controls:TextBoxHelper.WatermarkTrimming}"
                                       Visibility="Collapsed" />
                            <ContentControl x:Name="PART_FloatingMessageContainer"
                                            Grid.Row="0"
                                            Grid.Column="0"
                                            Style="{DynamicResource FloatingMessageContainerStyle}">
                                <ContentControl.Height>
                                    <MultiBinding Converter="{Converters:MathMultiplyConverter}">
                                        <Binding ElementName="PART_FloatingMessage"
                                                 Mode="OneWay"
                                                 Path="ActualHeight" />
                                        <Binding ElementName="PART_FloatingMessageContainer"
                                                 Mode="OneWay"
                                                 Path="Opacity" />
                                    </MultiBinding>
                                </ContentControl.Height>
                                <TextBlock x:Name="PART_FloatingMessage"
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                           Foreground="{TemplateBinding Foreground}"
                                           Style="{DynamicResource MetroAutoCollapsingTextBlock}"
                                           Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                           TextAlignment="{TemplateBinding Controls:TextBoxHelper.WatermarkAlignment}"
                                           TextTrimming="{TemplateBinding Controls:TextBoxHelper.WatermarkTrimming}">
                                    <TextBlock.RenderTransform>
                                        <TranslateTransform x:Name="FloatingMessageTransform">
                                            <TranslateTransform.Y>
                                                <MultiBinding Converter="{Converters:MathSubtractConverter}">
                                                    <Binding ElementName="PART_FloatingMessage"
                                                             Mode="OneWay"
                                                             Path="ActualHeight" />
                                                    <Binding ElementName="PART_FloatingMessageContainer"
                                                             Mode="OneWay"
                                                             Path="ActualHeight" />
                                                </MultiBinding>
                                            </TranslateTransform.Y>
                                        </TranslateTransform>
                                    </TextBlock.RenderTransform>
                                </TextBlock>
                            </ContentControl>
                            <ContentPresenter x:Name="PART_CapsLockIndicator"
                                              Grid.Row="0"
                                              Grid.RowSpan="2"
                                              Grid.Column="1"
                                              Margin="1"
                                              HorizontalAlignment="Right"
                                              VerticalAlignment="Center"
                                              Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockIcon), Mode=TwoWay}"
                                              TextBlock.Foreground="{DynamicResource ControlsValidationBrush}"
                                              ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockWarningToolTip), Mode=OneWay}"
                                              Visibility="Collapsed" />
                            <Button x:Name="PART_ClearText"
                                    Grid.Row="0"
                                    Grid.RowSpan="2"
                                    Grid.Column="2"
                                    Width="{TemplateBinding Controls:TextBoxHelper.ButtonWidth}"
                                    Controls:TextBoxHelper.IsClearTextButtonBehaviorEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ClearTextButton), Mode=OneWay}"
                                    Content="{TemplateBinding Controls:TextBoxHelper.ButtonContent}"
                                    ContentTemplate="{TemplateBinding Controls:TextBoxHelper.ButtonContentTemplate}"
                                    Focusable="False"
                                    FontFamily="{TemplateBinding Controls:TextBoxHelper.ButtonFontFamily}"
                                    FontSize="{TemplateBinding Controls:TextBoxHelper.ButtonFontSize}"
                                    Foreground="{TemplateBinding Foreground}"
                                    IsTabStop="False"
                                    Style="{DynamicResource ChromelessButtonStyle}"
                                    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ClearTextButton), Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}" />
                        </Grid>
                        <Border x:Name="DisabledVisualElement"
                                Background="{DynamicResource ControlsDisabledBrush}"
                                BorderBrush="{DynamicResource ControlsDisabledBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                IsHitTestVisible="False"
                                Opacity="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.DisabledVisualElementVisibility), Mode=OneWay}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.ButtonsAlignment)}" Value="Left">
                            <Setter TargetName="ButtonColumn" Property="Width" Value="*" />
                            <Setter TargetName="PART_ClearText" Property="Grid.Column" Value="0" />
                            <Setter TargetName="PART_ContentHost" Property="Grid.Column" Value="2" />
                            <Setter TargetName="PART_FloatingMessageContainer" Property="Grid.Column" Value="2" />
                            <Setter TargetName="PART_Message" Property="Grid.Column" Value="2" />
                            <Setter TargetName="TextColumn" Property="Width" Value="Auto" />
                        </DataTrigger>

                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Password, Mode=OneWay}" Value="">
                            <Setter TargetName="PART_Message" Property="Visibility" Value="Visible" />
                        </DataTrigger>

                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Path=IsVisible, RelativeSource={RelativeSource Self}}" Value="True" />
                                <Condition Binding="{Binding Path=(Controls:TextBoxHelper.UseFloatingWatermark), RelativeSource={RelativeSource Self}}" Value="True" />
                                <Condition Binding="{Binding Path=(Controls:TextBoxHelper.HasText), RelativeSource={RelativeSource Self}}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </MultiDataTrigger.EnterActions>
                            <MultiDataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </MultiDataTrigger.ExitActions>
                        </MultiDataTrigger>

                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Base" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="DisabledVisualElement" Property="Opacity" Value="0.6" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter TargetName="Base" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.FocusBorderBrush)}" />
                            <Setter TargetName="PART_FloatingMessage" Property="Foreground" Value="{DynamicResource AccentColorBrush}" />
                            <Setter TargetName="PART_FloatingMessage" Property="Opacity" Value="1" />
                        </Trigger>
                        <Trigger SourceName="PART_ClearText" Property="IsMouseOver" Value="True">
                            <Setter TargetName="PART_ClearText" Property="Background" Value="{DynamicResource GrayBrush8}" />
                            <Setter TargetName="PART_ClearText" Property="Foreground" Value="{DynamicResource AccentColorBrush}" />
                        </Trigger>
                        <Trigger SourceName="PART_ClearText" Property="IsPressed" Value="True">
                            <Setter TargetName="PART_ClearText" Property="Background" Value="{DynamicResource BlackBrush}" />
                            <Setter TargetName="PART_ClearText" Property="Foreground" Value="{DynamicResource WhiteBrush}" />
                        </Trigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Controls:TextBoxHelper.HasText" Value="False" />
                                <Condition Property="IsFocused" Value="True" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterGotFocus}" />
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitGotFocus}" />
                            </MultiTrigger.ExitActions>
                        </MultiTrigger>

                        <Trigger Property="Controls:TextBoxHelper.HasText" Value="True">
                            <Setter TargetName="PART_Message" Property="Visibility" Value="Visible" />
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterHasText}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitHasText}" />
                            </Trigger.ExitActions>
                        </Trigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsVisible" Value="True" />
                                <Condition Property="Controls:TextBoxHelper.IsWaitingForData" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Visible" />
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource WaitingForDataStoryboard}" />
                            </MultiTrigger.EnterActions>
                        </MultiTrigger>
                        <Trigger Property="Controls:TextBoxHelper.IsWaitingForData" Value="False">
                            <Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Validation.ErrorTemplate" Value="{DynamicResource ValidationErrorTemplate}" />
    </Style>

    <!--  Button Command PasswordBox Style  -->
    <Style x:Key="MetroButtonPasswordBox"
           BasedOn="{StaticResource MetroPasswordBox}"
           TargetType="{x:Type PasswordBox}">
        <Setter Property="Controls:TextBoxHelper.ButtonTemplate" Value="{DynamicResource ChromelessButtonTemplate}" />
        <Setter Property="Controls:TextBoxHelper.TextButton" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="enterGotFocus">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             To=".2"
                                             Duration="0:0:0.2" />
                        </Storyboard>
                        <Storyboard x:Key="exitGotFocus">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             Duration="0:0:0.2" />
                        </Storyboard>

                        <Storyboard x:Key="enterHasText">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             From=".2"
                                             To="0"
                                             Duration="0:0:0.2" />
                        </Storyboard>
                        <Storyboard x:Key="exitHasText">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             Duration="0:0:0.2" />
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid>
                        <AdornerDecorator x:Name="PART_WaitingForDataEffectAdornerDecorator" Visibility="Collapsed">
                            <Border x:Name="PART_WaitingForDataEffectGrid"
                                    Background="{TemplateBinding Background}"
                                    BorderBrush="Transparent"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Effect="{DynamicResource WaitingForDataEffect}"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </AdornerDecorator>
                        <Border x:Name="Base"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        <Grid x:Name="PART_InnerGrid" Margin="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Name="TextColumn" Width="*" />
                                <ColumnDefinition x:Name="CapsLockColumn" Width="Auto" />
                                <ColumnDefinition x:Name="ButtonColumn" Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition x:Name="ButtonRow" Height="*" />
                            </Grid.RowDefinitions>

                            <ScrollViewer x:Name="PART_ContentHost"
                                          Grid.Row="1"
                                          Grid.Column="0"
                                          Margin="2"
                                          VerticalAlignment="Stretch"
                                          Background="{x:Null}"
                                          BorderThickness="0"
                                          IsTabStop="False" />
                            <TextBlock x:Name="PART_Message"
                                       Grid.Row="1"
                                       Grid.Column="0"
                                       Margin="6 2 6 2"
                                       Padding="{TemplateBinding Padding}"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                       Foreground="{TemplateBinding Foreground}"
                                       Style="{DynamicResource MahApps.Metro.Styles.MetroWatermarkTextBlock}"
                                       Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                       TextAlignment="{TemplateBinding Controls:TextBoxHelper.WatermarkAlignment}"
                                       TextTrimming="{TemplateBinding Controls:TextBoxHelper.WatermarkTrimming}"
                                       Visibility="Collapsed" />
                            <ContentControl x:Name="PART_FloatingMessageContainer"
                                            Grid.Row="0"
                                            Grid.Column="0"
                                            Style="{DynamicResource FloatingMessageContainerStyle}">
                                <ContentControl.Height>
                                    <MultiBinding Converter="{Converters:MathMultiplyConverter}">
                                        <Binding ElementName="PART_FloatingMessage"
                                                 Mode="OneWay"
                                                 Path="ActualHeight" />
                                        <Binding ElementName="PART_FloatingMessageContainer"
                                                 Mode="OneWay"
                                                 Path="Opacity" />
                                    </MultiBinding>
                                </ContentControl.Height>
                                <TextBlock x:Name="PART_FloatingMessage"
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                           Foreground="{TemplateBinding Foreground}"
                                           Style="{DynamicResource MetroAutoCollapsingTextBlock}"
                                           Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                           TextAlignment="{TemplateBinding Controls:TextBoxHelper.WatermarkAlignment}"
                                           TextTrimming="{TemplateBinding Controls:TextBoxHelper.WatermarkTrimming}">
                                    <TextBlock.RenderTransform>
                                        <TranslateTransform x:Name="FloatingMessageTransform">
                                            <TranslateTransform.Y>
                                                <MultiBinding Converter="{Converters:MathSubtractConverter}">
                                                    <Binding ElementName="PART_FloatingMessage"
                                                             Mode="OneWay"
                                                             Path="ActualHeight" />
                                                    <Binding ElementName="PART_FloatingMessageContainer"
                                                             Mode="OneWay"
                                                             Path="ActualHeight" />
                                                </MultiBinding>
                                            </TranslateTransform.Y>
                                        </TranslateTransform>
                                    </TextBlock.RenderTransform>
                                </TextBlock>
                            </ContentControl>
                            <ContentPresenter x:Name="PART_CapsLockIndicator"
                                              Grid.Row="0"
                                              Grid.RowSpan="2"
                                              Grid.Column="1"
                                              Margin="1"
                                              HorizontalAlignment="Right"
                                              VerticalAlignment="Center"
                                              Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockIcon), Mode=TwoWay}"
                                              TextBlock.Foreground="{DynamicResource ControlsValidationBrush}"
                                              ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockWarningToolTip), Mode=OneWay}"
                                              Visibility="Collapsed" />
                            <Button x:Name="PART_ClearText"
                                    Grid.Row="0"
                                    Grid.RowSpan="2"
                                    Grid.Column="2"
                                    Width="{TemplateBinding Controls:TextBoxHelper.ButtonWidth}"
                                    Controls:TextBoxHelper.IsClearTextButtonBehaviorEnabled="True"
                                    Content="{TemplateBinding Controls:TextBoxHelper.ButtonContent}"
                                    ContentTemplate="{TemplateBinding Controls:TextBoxHelper.ButtonContentTemplate}"
                                    Focusable="False"
                                    FontFamily="{TemplateBinding Controls:TextBoxHelper.ButtonFontFamily}"
                                    FontSize="{TemplateBinding Controls:TextBoxHelper.ButtonFontSize}"
                                    Foreground="{TemplateBinding Foreground}"
                                    IsTabStop="False"
                                    Style="{DynamicResource ChromelessButtonStyle}"
                                    Template="{TemplateBinding Controls:TextBoxHelper.ButtonTemplate}"
                                    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.TextButton), Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}" />
                        </Grid>
                        <Border x:Name="DisabledVisualElement"
                                Background="{DynamicResource ControlsDisabledBrush}"
                                BorderBrush="{DynamicResource ControlsDisabledBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                IsHitTestVisible="False"
                                Opacity="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.DisabledVisualElementVisibility), Mode=OneWay}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.ButtonsAlignment)}" Value="Left">
                            <Setter TargetName="ButtonColumn" Property="Width" Value="*" />
                            <Setter TargetName="PART_ClearText" Property="Grid.Column" Value="0" />
                            <Setter TargetName="PART_ContentHost" Property="Grid.Column" Value="2" />
                            <Setter TargetName="PART_FloatingMessageContainer" Property="Grid.Column" Value="2" />
                            <Setter TargetName="PART_Message" Property="Grid.Column" Value="2" />
                            <Setter TargetName="TextColumn" Property="Width" Value="Auto" />
                        </DataTrigger>

                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Password, Mode=OneWay}" Value="">
                            <Setter TargetName="PART_Message" Property="Visibility" Value="Visible" />
                        </DataTrigger>

                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Path=IsVisible, RelativeSource={RelativeSource Self}}" Value="True" />
                                <Condition Binding="{Binding Path=(Controls:TextBoxHelper.UseFloatingWatermark), RelativeSource={RelativeSource Self}}" Value="True" />
                                <Condition Binding="{Binding Path=(Controls:TextBoxHelper.HasText), RelativeSource={RelativeSource Self}}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </MultiDataTrigger.EnterActions>
                            <MultiDataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </MultiDataTrigger.ExitActions>
                        </MultiDataTrigger>

                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Base" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="DisabledVisualElement" Property="Opacity" Value="0.6" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter TargetName="Base" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.FocusBorderBrush)}" />
                            <Setter TargetName="PART_FloatingMessage" Property="Foreground" Value="{DynamicResource AccentColorBrush}" />
                            <Setter TargetName="PART_FloatingMessage" Property="Opacity" Value="1" />
                        </Trigger>
                        <Trigger SourceName="PART_ClearText" Property="IsMouseOver" Value="True">
                            <Setter TargetName="PART_ClearText" Property="Background" Value="{DynamicResource GrayBrush8}" />
                            <Setter TargetName="PART_ClearText" Property="Foreground" Value="{DynamicResource AccentColorBrush}" />
                        </Trigger>
                        <Trigger SourceName="PART_ClearText" Property="IsPressed" Value="True">
                            <Setter TargetName="PART_ClearText" Property="Background" Value="{DynamicResource BlackBrush}" />
                            <Setter TargetName="PART_ClearText" Property="Foreground" Value="{DynamicResource WhiteBrush}" />
                        </Trigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Controls:TextBoxHelper.HasText" Value="False" />
                                <Condition Property="IsFocused" Value="True" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterGotFocus}" />
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitGotFocus}" />
                            </MultiTrigger.ExitActions>
                        </MultiTrigger>
                        <Trigger Property="Controls:TextBoxHelper.HasText" Value="True">
                            <Setter TargetName="PART_Message" Property="Visibility" Value="Visible" />
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterHasText}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitHasText}" />
                            </Trigger.ExitActions>
                        </Trigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsVisible" Value="True" />
                                <Condition Property="Controls:TextBoxHelper.IsWaitingForData" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Visible" />
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource WaitingForDataStoryboard}" />
                            </MultiTrigger.EnterActions>
                        </MultiTrigger>
                        <Trigger Property="Controls:TextBoxHelper.IsWaitingForData" Value="False">
                            <Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="RevealedTextBoxStyle" TargetType="{x:Type TextBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                        <ScrollViewer x:Name="PART_ContentHost"
                                      Margin="{TemplateBinding Padding}"
                                      Background="{x:Null}"
                                      BorderThickness="0"
                                      IsTabStop="False" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  Button Revealed PasswordBox Style  -->
    <Style x:Key="MetroButtonRevealedPasswordBox"
           BasedOn="{StaticResource MetroPasswordBox}"
           TargetType="{x:Type PasswordBox}">
        <Setter Property="Controls:PasswordBoxHelper.RevealButtonContent" Value="{DynamicResource DefaultRevealButtonIcon}" />
        <Setter Property="Controls:TextBoxHelper.ButtonTemplate" Value="{DynamicResource ChromelessButtonTemplate}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="enterGotFocus">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             To=".2"
                                             Duration="0:0:0.2" />
                        </Storyboard>
                        <Storyboard x:Key="exitGotFocus">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             Duration="0:0:0.2" />
                        </Storyboard>

                        <Storyboard x:Key="enterHasText">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             From=".2"
                                             To="0"
                                             Duration="0:0:0.2" />
                        </Storyboard>
                        <Storyboard x:Key="exitHasText">
                            <DoubleAnimation Storyboard.TargetName="PART_Message"
                                             Storyboard.TargetProperty="Opacity"
                                             Duration="0:0:0.2" />
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid>
                        <AdornerDecorator x:Name="PART_WaitingForDataEffectAdornerDecorator" Visibility="Collapsed">
                            <Border x:Name="PART_WaitingForDataEffectGrid"
                                    Background="{TemplateBinding Background}"
                                    BorderBrush="Transparent"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Effect="{DynamicResource WaitingForDataEffect}"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </AdornerDecorator>
                        <Border x:Name="Base"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        <Grid x:Name="PART_InnerGrid" Margin="2">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Name="TextColumn" Width="*" />
                                <ColumnDefinition x:Name="CapsLockColumn" Width="Auto" />
                                <ColumnDefinition x:Name="RevealButtonColumn" Width="Auto" />
                                <ColumnDefinition x:Name="ButtonColumn" Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition x:Name="ButtonRow" Height="*" />
                            </Grid.RowDefinitions>

                            <ScrollViewer x:Name="PART_ContentHost"
                                          Grid.Row="1"
                                          Grid.Column="0"
                                          Margin="2"
                                          VerticalAlignment="Stretch"
                                          Background="{x:Null}"
                                          BorderThickness="0"
                                          IsTabStop="False" />
                            <TextBox x:Name="RevealedPassword"
                                     Grid.Row="1"
                                     Grid.Column="0"
                                     Margin="2"
                                     Padding="{TemplateBinding Padding}"
                                     HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                     VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                     Background="{TemplateBinding Background}"
                                     BorderThickness="0"
                                     CaretBrush="{TemplateBinding CaretBrush}"
                                     FocusManager.FocusedElement="{Binding RelativeSource={RelativeSource Self}}"
                                     FontFamily="{TemplateBinding FontFamily}"
                                     FontSize="{TemplateBinding FontSize}"
                                     Foreground="{TemplateBinding Foreground}"
                                     SelectionBrush="{TemplateBinding SelectionBrush}"
                                     SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                     Style="{DynamicResource RevealedTextBoxStyle}"
                                     Text="{TemplateBinding Behaviors:PasswordBoxBindingBehavior.Password}"
                                     Visibility="Hidden" />
                            <TextBlock x:Name="PART_Message"
                                       Grid.Row="1"
                                       Grid.Column="0"
                                       Margin="6 2 6 2"
                                       Padding="{TemplateBinding Padding}"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                       Foreground="{TemplateBinding Foreground}"
                                       Style="{DynamicResource MahApps.Metro.Styles.MetroWatermarkTextBlock}"
                                       Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                       TextAlignment="{TemplateBinding Controls:TextBoxHelper.WatermarkAlignment}"
                                       TextTrimming="{TemplateBinding Controls:TextBoxHelper.WatermarkTrimming}"
                                       Visibility="Collapsed" />
                            <ContentControl x:Name="PART_FloatingMessageContainer"
                                            Grid.Row="0"
                                            Grid.Column="0"
                                            Style="{DynamicResource FloatingMessageContainerStyle}">
                                <ContentControl.Height>
                                    <MultiBinding Converter="{Converters:MathMultiplyConverter}">
                                        <Binding ElementName="PART_FloatingMessage"
                                                 Mode="OneWay"
                                                 Path="ActualHeight" />
                                        <Binding ElementName="PART_FloatingMessageContainer"
                                                 Mode="OneWay"
                                                 Path="Opacity" />
                                    </MultiBinding>
                                </ContentControl.Height>
                                <TextBlock x:Name="PART_FloatingMessage"
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                           VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                           Foreground="{TemplateBinding Foreground}"
                                           Style="{DynamicResource MetroAutoCollapsingTextBlock}"
                                           Text="{TemplateBinding Controls:TextBoxHelper.Watermark}"
                                           TextAlignment="{TemplateBinding Controls:TextBoxHelper.WatermarkAlignment}"
                                           TextTrimming="{TemplateBinding Controls:TextBoxHelper.WatermarkTrimming}">
                                    <TextBlock.RenderTransform>
                                        <TranslateTransform x:Name="FloatingMessageTransform">
                                            <TranslateTransform.Y>
                                                <MultiBinding Converter="{Converters:MathSubtractConverter}">
                                                    <Binding ElementName="PART_FloatingMessage"
                                                             Mode="OneWay"
                                                             Path="ActualHeight" />
                                                    <Binding ElementName="PART_FloatingMessageContainer"
                                                             Mode="OneWay"
                                                             Path="ActualHeight" />
                                                </MultiBinding>
                                            </TranslateTransform.Y>
                                        </TranslateTransform>
                                    </TextBlock.RenderTransform>
                                </TextBlock>
                            </ContentControl>
                            <ContentPresenter x:Name="PART_CapsLockIndicator"
                                              Grid.Row="0"
                                              Grid.RowSpan="2"
                                              Grid.Column="1"
                                              Margin="1"
                                              HorizontalAlignment="Right"
                                              VerticalAlignment="Center"
                                              Content="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockIcon), Mode=TwoWay}"
                                              TextBlock.Foreground="{DynamicResource ControlsValidationBrush}"
                                              ToolTip="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:PasswordBoxHelper.CapsLockWarningToolTip), Mode=OneWay}"
                                              Visibility="Collapsed" />
                            <Button x:Name="PART_RevealButton"
                                    Grid.Row="0"
                                    Grid.RowSpan="2"
                                    Grid.Column="2"
                                    Width="{TemplateBinding Controls:TextBoxHelper.ButtonWidth}"
                                    Content="{TemplateBinding Controls:PasswordBoxHelper.RevealButtonContent}"
                                    ContentTemplate="{TemplateBinding Controls:PasswordBoxHelper.RevealButtonContentTemplate}"
                                    Focusable="False"
                                    Foreground="{TemplateBinding Foreground}"
                                    IsTabStop="False"
                                    Style="{DynamicResource RevealButtonStyle}"
                                    Visibility="{Binding ElementName=RevealedPassword, Path=Text, Converter={StaticResource StringToVisibilityConverter}}" />
                            <Button x:Name="PART_ClearText"
                                    Grid.Row="0"
                                    Grid.RowSpan="2"
                                    Grid.Column="3"
                                    Width="{TemplateBinding Controls:TextBoxHelper.ButtonWidth}"
                                    Controls:TextBoxHelper.IsClearTextButtonBehaviorEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ClearTextButton), Mode=OneWay}"
                                    Content="{TemplateBinding Controls:TextBoxHelper.ButtonContent}"
                                    ContentTemplate="{TemplateBinding Controls:TextBoxHelper.ButtonContentTemplate}"
                                    Focusable="False"
                                    FontFamily="{TemplateBinding Controls:TextBoxHelper.ButtonFontFamily}"
                                    FontSize="{TemplateBinding Controls:TextBoxHelper.ButtonFontSize}"
                                    Foreground="{TemplateBinding Foreground}"
                                    IsTabStop="False"
                                    Style="{DynamicResource ChromelessButtonStyle}"
                                    Template="{TemplateBinding Controls:TextBoxHelper.ButtonTemplate}"
                                    Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:TextBoxHelper.ClearTextButton), Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}" />
                        </Grid>
                        <Border x:Name="DisabledVisualElement"
                                Background="{DynamicResource ControlsDisabledBrush}"
                                BorderBrush="{DynamicResource ControlsDisabledBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                IsHitTestVisible="False"
                                Opacity="0"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.DisabledVisualElementVisibility), Mode=OneWay}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(Controls:TextBoxHelper.ButtonsAlignment)}" Value="Left">
                            <Setter TargetName="ButtonColumn" Property="Width" Value="*" />
                            <Setter TargetName="PART_CapsLockIndicator" Property="Grid.Column" Value="2" />
                            <Setter TargetName="PART_ClearText" Property="Grid.Column" Value="0" />
                            <Setter TargetName="PART_ContentHost" Property="Grid.Column" Value="3" />
                            <Setter TargetName="PART_FloatingMessageContainer" Property="Grid.Column" Value="3" />
                            <Setter TargetName="PART_Message" Property="Grid.Column" Value="3" />
                            <Setter TargetName="PART_RevealButton" Property="Grid.Column" Value="1" />
                            <Setter TargetName="RevealedPassword" Property="Grid.Column" Value="3" />
                            <Setter TargetName="TextColumn" Property="Width" Value="Auto" />
                        </DataTrigger>

                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Password, Mode=OneWay}" Value="">
                            <Setter TargetName="PART_Message" Property="Visibility" Value="Visible" />
                        </DataTrigger>

                        <MultiDataTrigger>
                            <MultiDataTrigger.Conditions>
                                <Condition Binding="{Binding Path=IsVisible, RelativeSource={RelativeSource Self}}" Value="True" />
                                <Condition Binding="{Binding Path=(Controls:TextBoxHelper.UseFloatingWatermark), RelativeSource={RelativeSource Self}}" Value="True" />
                                <Condition Binding="{Binding Path=(Controls:TextBoxHelper.HasText), RelativeSource={RelativeSource Self}}" Value="True" />
                            </MultiDataTrigger.Conditions>
                            <MultiDataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource ShowFloatingMessageStoryboard}" />
                            </MultiDataTrigger.EnterActions>
                            <MultiDataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource HideFloatingMessageStoryboard}" />
                            </MultiDataTrigger.ExitActions>
                        </MultiDataTrigger>

                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Base" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="DisabledVisualElement" Property="Opacity" Value="0.6" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter TargetName="Base" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.FocusBorderBrush)}" />
                            <Setter TargetName="PART_FloatingMessage" Property="Foreground" Value="{DynamicResource AccentColorBrush}" />
                            <Setter TargetName="PART_FloatingMessage" Property="Opacity" Value="1" />
                        </Trigger>
                        <Trigger SourceName="PART_RevealButton" Property="IsMouseOver" Value="True">
                            <Setter TargetName="PART_RevealButton" Property="Background" Value="{DynamicResource GrayBrush8}" />
                            <Setter TargetName="PART_RevealButton" Property="Foreground" Value="{DynamicResource AccentColorBrush}" />
                        </Trigger>
                        <Trigger SourceName="PART_RevealButton" Property="IsPressed" Value="True">
                            <Setter TargetName="PART_ContentHost" Property="Visibility" Value="Hidden" />
                            <Setter TargetName="PART_RevealButton" Property="Background" Value="{DynamicResource BlackBrush}" />
                            <Setter TargetName="PART_RevealButton" Property="Foreground" Value="{DynamicResource WhiteBrush}" />
                            <Setter TargetName="RevealedPassword" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger SourceName="PART_ClearText" Property="IsMouseOver" Value="True">
                            <Setter TargetName="PART_ClearText" Property="Background" Value="{DynamicResource GrayBrush8}" />
                            <Setter TargetName="PART_ClearText" Property="Foreground" Value="{DynamicResource AccentColorBrush}" />
                        </Trigger>
                        <Trigger SourceName="PART_ClearText" Property="IsPressed" Value="True">
                            <Setter TargetName="PART_ClearText" Property="Background" Value="{DynamicResource BlackBrush}" />
                            <Setter TargetName="PART_ClearText" Property="Foreground" Value="{DynamicResource WhiteBrush}" />
                        </Trigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="Controls:TextBoxHelper.HasText" Value="False" />
                                <Condition Property="IsFocused" Value="True" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterGotFocus}" />
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitGotFocus}" />
                            </MultiTrigger.ExitActions>
                        </MultiTrigger>
                        <Trigger Property="Controls:TextBoxHelper.HasText" Value="True">
                            <Setter TargetName="PART_Message" Property="Visibility" Value="Visible" />
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource enterHasText}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource exitHasText}" />
                            </Trigger.ExitActions>
                        </Trigger>

                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsVisible" Value="True" />
                                <Condition Property="Controls:TextBoxHelper.IsWaitingForData" Value="True" />
                            </MultiTrigger.Conditions>
                            <Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Visible" />
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource WaitingForDataStoryboard}" />
                            </MultiTrigger.EnterActions>
                        </MultiTrigger>
                        <Trigger Property="Controls:TextBoxHelper.IsWaitingForData" Value="False">
                            <Setter TargetName="PART_WaitingForDataEffectAdornerDecorator" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--  Win8MetroPasswordBox Style  -->
    <Style x:Key="Win8MetroPasswordBox"
           BasedOn="{StaticResource MetroButtonRevealedPasswordBox}"
           TargetType="{x:Type PasswordBox}">
        <Setter Property="AllowDrop" Value="true" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="FontSize" Value="15" />
    </Style>

</ResourceDictionary>