LabelStyle.xaml 13.3 KB
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style TargetType="{x:Type Label}"></Style>

    <Style x:Key="BaseLabel" TargetType="Label">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="White"/>
    </Style>

    <Style x:Key="BaseLabelHeader" TargetType="Label">
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="Background" Value="#0c386f"/>
    </Style>
    
    <Style x:Key="MessageBoxTitle" TargetType="{x:Type Label}">
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="Foreground" Value="{DynamicResource MessageBoxTitleBrush}" />
    </Style>

    <Style x:Key="DensoLabel" TargetType="{x:Type Label}">
        <Setter Property="Height" Value="28"/>
        <Setter Property="Background" Value="#0c386f"/>
        <Setter Property="BorderBrush" Value="#7795bd" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
    </Style>

    <Style x:Key="DensoLabelSetting" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabel}">
        <Setter Property="Height" Value="28"/>
    </Style>

    <Style x:Key="DensoLabelNoBorder" TargetType="{x:Type Label}">
        <Setter Property="Background" Value="#0c386f"/>
        <Setter Property="Foreground" Value="White" />
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
    </Style>

    <Style x:Key="DensoBorderLabel" TargetType="{x:Type Border}">
        <Setter Property="Background" Value="#0c386f"/>
        <Setter Property="BorderBrush" Value="#7795bd" />
        <Setter Property="BorderThickness" Value="1" />
    </Style>

    <Style x:Key="DensoLabelExtendHeight" TargetType="{x:Type Label}">
        <Setter Property="Background" Value="#0c386f"/>
        <Setter Property="BorderBrush" Value="#7795bd" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1"/>
    </Style>

    <Style x:Key="DensoLabelTransparent" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabel}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0" />
    </Style>

    <Style x:Key="DensoLabelTransparentSmall" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabelTransparent}">
        <Setter Property="Height" Value="15"/>
        <Setter Property="FontSize" Value="10" />
        <Setter Property="Padding" Value="0" />
    </Style>

    <Style x:Key="DensoCommonLabel" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabel}">
        <Setter Property="Margin" Value="5,1"/>
    </Style>

    <Style x:Key="DensoTransparentLabel" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoCommonLabel}">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
    </Style>

    <Style x:Key="DensoLabelRegistrationGridHeader" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabel}">
        <Setter Property="Height" Value="30"/>
        <Setter Property="FontSize" Value="15"></Setter>
    </Style>

    <Style x:Key="DensoLabelRegistration" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabel}">
        <Setter Property="Width" Value="140"/>
    </Style>

    

    <Style x:Key="DensoLabelReportHeader" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabel}">
        <Setter Property="Height" Value="40"/>
        <!--<Setter Property="Width" Value="400"/>-->
        <Setter Property="FontSize" Value="20"></Setter>
    </Style>

    <!--20150629 quyennk add-->
    <Style x:Key="DensoLabelReportSetting" TargetType="{x:Type Label}" >
        <Setter Property="FontSize" Value="15"/>
        <Setter Property="Foreground" Value="White" />
        <Setter Property="HorizontalAlignment" Value="Left" />
    </Style>


    <Style x:Key="SettingHeader" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabel}">
        <Setter Property="FontSize" Value="16"/>
        <Setter Property="FontWeight" Value="Bold"/>
        <Setter Property="Height" Value="40"/>
    </Style>

    <Style x:Key="DensoGridTextBoxStyle" TargetType="{x:Type TextBox}">
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Background" Value="White"/>
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="BorderBrush" Value="#FFAAAAAA" />
        <Setter Property="Padding" Value="2"/>
        <Setter Property="FontSize" Value="12"/>
        <Setter Property="Padding" Value="0pt,0pt,0pt,0pt"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <ControlTemplate.Resources>
                        <Storyboard x:Key="FocusedOn">
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                        <Storyboard x:Key="FocusedOff">
                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
                                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                        <Storyboard x:Key="DisabledOn">
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.1000000" Value="{x:Static Visibility.Visible}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                        <Storyboard x:Key="DisabledOff">
                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <DiscreteObjectKeyFrame KeyTime="00:00:00.1000000" Value="{x:Static Visibility.Collapsed}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </ControlTemplate.Resources>
                    <Grid>
                        <Border Margin="1" x:Name="BorderBase" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" />
                        <Border Margin="0" Background="#FFECF5FD" x:Name="FocusVisualElement" BorderBrush="#FFECF5FD" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="7" IsHitTestVisible="False" Opacity="0" >
                            <Border Background="#FFE3F1FC" x:Name="InnerFocusVisualElement" BorderBrush="#FFE3F1FC" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5" IsHitTestVisible="False" Opacity="1" >
                                <Border Background="#FFD9ECFA" x:Name="InnerFocusVisualElement2" BorderBrush="#FFD9ECFA" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" IsHitTestVisible="False" Opacity="1" >
                                    <Border Background="{TemplateBinding Background}" x:Name="InnerFocusVisualElement3" BorderBrush="#FF7DBEF1" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" IsHitTestVisible="False" Opacity="1" >
                                    </Border>
                                </Border>
                            </Border>
                        </Border>
                        <Label Foreground="Black"  Grid.Column="1" Margin="1" x:Name="TextPrompt" Content="{TemplateBinding Tag}" Visibility="Collapsed" Focusable="False"></Label>
                        <ScrollViewer Margin="1" x:Name="PART_ContentHost" Foreground="{TemplateBinding Foreground}" />
                        <Border Margin="1" x:Name="DisabledVisualElement" Background="#A5FFFFFF" BorderBrush="#59C0C0C0" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" IsHitTestVisible="False" Visibility="Collapsed" />
                        <Border Margin="1" x:Name="ReadOnlyVisualElement" Background="#66FFFFFF" CornerRadius="2.75" Visibility="Collapsed" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsFocused" Value="False"></Condition>
                                <Condition Property="Text" Value=""></Condition>
                            </MultiTrigger.Conditions>
                            <MultiTrigger.Setters>
                                <Setter Property="Visibility" TargetName="TextPrompt" Value="Visible"></Setter>
                            </MultiTrigger.Setters>
                        </MultiTrigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Trigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource FocusedOff}" x:Name="FocusedOff_BeginStoryboard" />
                            </Trigger.ExitActions>
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource FocusedOn}" x:Name="FocusedOn_BeginStoryboard" />
                            </Trigger.EnterActions>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource DisabledOn}" x:Name="DisabledOn_BeginStoryboard" />
                            </Trigger.EnterActions>

                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource DisabledOff}" />
                            </Trigger.EnterActions>

                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!--Region New Style-->
    <Style x:Key="DensoSmallHeaderLabel" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabel}">
        <Setter Property="Focusable" Value="false"></Setter>
        <Setter Property="FontSize" Value="15"/>
        <Setter Property="FontWeight" Value="Bold"></Setter>
        <Setter Property="VerticalAlignment" Value="Center"></Setter>
        <Setter Property="Height" Value="30"></Setter>
    </Style>
    <Style x:Key="DensoSmallHeaderLabelNoBorder" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabelNoBorder}">
        <Setter Property="Focusable" Value="false"></Setter>
        <Setter Property="FontSize" Value="15"/>
        <Setter Property="FontWeight" Value="Bold"></Setter>
        <Setter Property="VerticalAlignment" Value="Center"></Setter>
        <Setter Property="Height" Value="30"></Setter>
        <Setter Property="BorderBrush" Value="#7795bd"></Setter>
        <Setter Property="BorderThickness" Value="0 0 0 1"></Setter>
    </Style>

    <Style x:Key="DensoLabelRegistration2" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabel}">
        <Setter Property="Width" Value="150"/>
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="Height" Value="30"></Setter>
    </Style>
    <Style x:Key="TopLabelHeader" TargetType="{x:Type Label}">
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="FontSize" Value="14"/>
    </Style>
    <Style x:Key="DensoLabelReportHeader2" TargetType="{x:Type Label}">
        <Setter Property="Height" Value="30"/>
        <Setter Property="FontSize" Value="15"></Setter>
    </Style>
    <Style x:Key="DensoGroupboxHeader" TargetType="{x:Type Label}" BasedOn="{StaticResource DensoLabel}">
        <Setter Property="Height" Value="30"/>
        <Setter Property="FontSize" Value="15"></Setter>
        <Setter Property="FontWeight" Value="Medium"/>
    </Style>
    <!--endregion-->
</ResourceDictionary>