Тэги

Silverlight (36) WPF (10) IIS (7) Visual Studio (7) SharePoint (6) .Net Framework (5) ODP.NET (5) ASP.NET (4) C# (4) common (4) Network Settings (3) JavaScript (2) MS Office (2) Resharper (2) WCF (2) WEB (2) XPath (2) XSLT (2) ADO.NET (1) APEX (1) CMD (1) CSS (1) EF (1) HTML (1) Hardware bugs (1) Java (1) MS SQL (1) Oracle (1) PDF (1) Version Control (1) XAML (1)

суббота, 31 октября 2009 г.

Дополнение к предыдущему посту “Темы в Silverlight Toolkit October убивают валидацию в TextBox. Т.е. валидационный View. Видимо так было раньше и пока так будет, но это несложно поправить.”.



Предыдущий пост: Темы в Silverlight Toolkit October убивают валидацию в TextBox. Т.е. валидационный View. Видимо так было раньше и пока так будет, но это несложно поправить.

Продолжение предыдущего поста:

А вот безобразие, которое было до этого:
___________
<!--Textbox-->
<Style TargetType="TextBox">
    <Setter Property="BorderThickness"
        Value="1"/>
    <Setter Property="Background"
        Value="{StaticResource ShadeBrush}"/>
    <Setter Property="Foreground"
        Value="#FF000000"/>
    <Setter Property="Padding"
        Value="2"/>
    <Setter Property="BorderBrush"
        Value="{StaticResource NormalBorderBrush}" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="TextBox">
                <Grid >
                    <vsm:VisualStateManager.VisualStateGroups>
                        <vsm:VisualStateGroup x:Name="CommonStates">
                            <vsm:VisualStateGroup.Transitions>
                                <vsm:VisualTransition GeneratedDuration="00:00:00.1"
                                    To="MouseOver"/>
                                <vsm:VisualTransition GeneratedDuration="00:00:00.1"
                                    To="ReadOnly"/>
                                <vsm:VisualTransition GeneratedDuration="00:00:00.1"
                                    To="Disabled"/>
                                <vsm:VisualTransition From="Normal"
                                    GeneratedDuration="00:00:00.3000000"
                                    To="MouseOver"/>
                                <vsm:VisualTransition From="MouseOver"
                                    GeneratedDuration="00:00:00.5000000"
                                    To="Normal"/>
                            </vsm:VisualStateGroup.Transitions>
                            <vsm:VisualState x:Name="Normal"/>
                            <vsm:VisualState x:Name="MouseOver">
                                <Storyboard>
                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                               Duration="00:00:00.0010000"
                                               Storyboard.TargetName="HoverBorder"
                                               Storyboard.TargetProperty="(UIElement.Opacity)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00"
                                        Value="1"/>
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </vsm:VisualState>
                            <vsm:VisualState x:Name="Disabled">
                                <Storyboard>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement"
                                               Storyboard.TargetProperty="Opacity">
                                        <SplineDoubleKeyFrame KeyTime="0"
                                        Value="0.6"/>
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </vsm:VisualState>
                            <vsm:VisualState x:Name="ReadOnly">
                                <Storyboard>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ReadOnlyVisualElement"
                                               Storyboard.TargetProperty="Opacity">
                                        <SplineDoubleKeyFrame KeyTime="0"
                                        Value="1"/>
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </vsm:VisualState>
                        </vsm:VisualStateGroup>
                        <vsm:VisualStateGroup x:Name="FocusStates">
                            <vsm:VisualStateGroup.Transitions>
                                <vsm:VisualTransition From="Focused"
                                    GeneratedDuration="00:00:00.5000000"
                                    To="Unfocused"/>
                                <vsm:VisualTransition From="Unfocused"
                                    GeneratedDuration="00:00:00.3000000"
                                    To="Focused"/>
                            </vsm:VisualStateGroup.Transitions>
                            <vsm:VisualState x:Name="Focused">
                                <Storyboard>


                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                               Duration="00:00:00.0010000"
                                               Storyboard.TargetName="FocusVisualElement"
                                               Storyboard.TargetProperty="(UIElement.Opacity)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00"
                                        Value="1"/>
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </vsm:VisualState>
                            <vsm:VisualState x:Name="Unfocused">
                                <Storyboard>
                                    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                               Duration="00:00:00.0010000"
                                               Storyboard.TargetName="FocusVisualElement"
                                               Storyboard.TargetProperty="(UIElement.Opacity)">
                                        <SplineDoubleKeyFrame KeyTime="00:00:00"
                                        Value="0"/>
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </vsm:VisualState>
                        </vsm:VisualStateGroup>
                    </vsm:VisualStateManager.VisualStateGroups>
                    <Border x:Name="Border"
                Opacity="1"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                CornerRadius="2,2,2,2">
                        <Grid>
                            <Border x:Name="ReadOnlyVisualElement"
                    Opacity="0"
                    Background="#72F7F7F7"/>
                            <Border BorderThickness="1"
                    CornerRadius="1,1,1,1">
                                <Border.BorderBrush>
                                    <SolidColorBrush Color="Transparent"
                                 x:Name="MouseOverColor"/>
                                </Border.BorderBrush>
                                <ScrollViewer BorderThickness="0"
                            IsTabStop="False"
                            Padding="{TemplateBinding Padding}"
                            x:Name="ContentElement"/>
                            </Border>
                        </Grid>
                    </Border>
                    <Border x:Name="HoverBorder"
                Opacity="0"
                BorderBrush="{StaticResource NormalBrush}"
                BorderThickness="2,2,2,2"
                CornerRadius="2,2,2,2"/>
                    <Border x:Name="DisabledVisualElement"
                IsHitTestVisible="False"
                Opacity="0"
                Background="#FFFFFFFF"
                BorderBrush="#A5F7F7F7"
                BorderThickness="{TemplateBinding BorderThickness}"
                CornerRadius="2,2,2,2"/>
                    <Border Margin="1"
                x:Name="FocusVisualElement"
                IsHitTestVisible="False"
                Opacity="0"
                BorderBrush="{StaticResource NormalBrush}"
                BorderThickness="2.1,2.1,2.1,2.1"
                CornerRadius="0.2,0.2,0.2,0.2"/>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>


Комментариев нет:

Отправить комментарий