Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ControlTemplate x:Key="ErrorTemplateSilverlightStyle">
- <StackPanel Orientation="Horizontal" d:DesignWidth="208.75" d:DesignHeight="22.373">
- <i:Interaction.Triggers>
- <i:EventTrigger>
- <ei:GoToStateAction StateName="StringHidden" UseTransitions="False"/>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="ErrorStringVisibility">
- <VisualStateGroup.Transitions>
- <VisualTransition GeneratedDuration="0:0:0.2">
- <VisualTransition.GeneratedEasingFunction>
- <CubicEase EasingMode="EaseOut"/>
- </VisualTransition.GeneratedEasingFunction>
- </VisualTransition>
- <VisualTransition From="StringHidden" GeneratedDuration="0:0:0.2" To="StringVisible">
- <VisualTransition.GeneratedEasingFunction>
- <CubicEase EasingMode="EaseOut"/>
- </VisualTransition.GeneratedEasingFunction>
- <Storyboard>
- <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.IsOpen)" Storyboard.TargetName="popup">
- <DiscreteBooleanKeyFrame KeyTime="0" Value="True"/>
- </BooleanAnimationUsingKeyFrames>
- <DoubleAnimation Duration="0:0:0.2" From="-50" Storyboard.TargetProperty="(Popup.HorizontalOffset)" Storyboard.TargetName="popup">
- <DoubleAnimation.EasingFunction>
- <CubicEase EasingMode="EaseOut"/>
- </DoubleAnimation.EasingFunction>
- </DoubleAnimation>
- </Storyboard>
- </VisualTransition>
- <VisualTransition From="StringVisible" GeneratedDuration="0:0:0.2" To="StringHidden">
- <VisualTransition.GeneratedEasingFunction>
- <CubicEase EasingMode="EaseOut"/>
- </VisualTransition.GeneratedEasingFunction>
- <Storyboard>
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.HorizontalOffset)" Storyboard.TargetName="popup">
- <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
- <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-50">
- <EasingDoubleKeyFrame.EasingFunction>
- <CubicEase EasingMode="EaseOut"/>
- </EasingDoubleKeyFrame.EasingFunction>
- </EasingDoubleKeyFrame>
- </DoubleAnimationUsingKeyFrames>
- <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.IsOpen)" Storyboard.TargetName="popup">
- <DiscreteBooleanKeyFrame KeyTime="0" Value="True"/>
- <DiscreteBooleanKeyFrame KeyTime="0:0:0.2" Value="False"/>
- </BooleanAnimationUsingKeyFrames>
- </Storyboard>
- </VisualTransition>
- </VisualStateGroup.Transitions>
- <VisualState x:Name="StringHidden">
- <Storyboard>
- <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.IsOpen)" Storyboard.TargetName="popup">
- <DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
- </BooleanAnimationUsingKeyFrames>
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="errorBorder">
- <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
- </DoubleAnimationUsingKeyFrames>
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.HorizontalOffset)" Storyboard.TargetName="popup">
- <EasingDoubleKeyFrame KeyTime="0" Value="50"/>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="StringVisible">
- <Storyboard>
- <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.IsOpen)" Storyboard.TargetName="popup">
- <DiscreteBooleanKeyFrame KeyTime="0" Value="True"/>
- </BooleanAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- <Border BorderThickness="2" BorderBrush="{DynamicResource ErrorColor}"
- VerticalAlignment="Top" Background="{x:Null}" Margin="0" Padding="0">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="MouseEnter">
- <ei:GoToStateAction StateName="StringVisible"/>
- </i:EventTrigger>
- <i:EventTrigger EventName="MouseLeave">
- <ei:GoToStateAction StateName="StringHidden"/>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <Grid Margin="0" Visibility="Visible">
- <AdornedElementPlaceholder x:Name="adorner" Visibility="Visible"/>
- <StackPanel Margin="0" Orientation="Horizontal" HorizontalAlignment="Right" Background="#00000000" Visibility="Visible">
- <Path Data="M0,0 L100,0 100,28.373333 z" Fill="{DynamicResource ErrorColor}" Stretch="Fill" Width="16" Visibility="Collapsed" Margin="0"/>
- <ed:RegularPolygon Fill="{DynamicResource ErrorColor}" Height="Auto" InnerRadius="1" Margin="0,0,-8,0" PointCount="3" Stretch="Fill" Width="16" RenderTransformOrigin="0.5,0.5">
- <ed:RegularPolygon.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform/>
- <RotateTransform Angle="180"/>
- <TranslateTransform/>
- </TransformGroup>
- </ed:RegularPolygon.RenderTransform>
- </ed:RegularPolygon>
- <Border BorderBrush="{x:Null}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Background="{DynamicResource ErrorColor}" Margin="0" Visibility="Visible">
- <Path Data="{DynamicResource Shape_X}" Fill="White" HorizontalAlignment="Center" Height="Auto" Opacity="1" RenderTransformOrigin="0.5,0.5" Stretch="Fill" VerticalAlignment="Center" Width="Auto" Margin="2,0,3,0">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform/>
- <RotateTransform/>
- <TranslateTransform/>
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- </Border>
- </StackPanel>
- </Grid>
- </Border>
- <Popup x:Name="popup" Placement="Right" Width="Auto" AllowsTransparency="True" StaysOpen="True" RenderTransformOrigin="0.5,0.5" IsHitTestVisible="False" VerticalAlignment="Center">
- <Popup.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform/>
- <RotateTransform/>
- <TranslateTransform/>
- </TransformGroup>
- </Popup.RenderTransform>
- <Border x:Name="errorBorder" Background="{DynamicResource ErrorColor}" Margin="0,0,5,5"
- Opacity="1"
- IsHitTestVisible="False"
- MinHeight="24" MaxWidth="267" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center">
- <Border.RenderTransform>
- <TransformGroup>
- <ScaleTransform/>
- <SkewTransform/>
- <RotateTransform/>
- <TranslateTransform X="0"/>
- </TransformGroup>
- </Border.RenderTransform>
- <Border.Effect>
- <DropShadowEffect ShadowDepth="4"
- Color="Black"
- Opacity="0.4"
- Direction="315"
- BlurRadius="4"/>
- </Border.Effect>
- <TextBlock Text="{Binding Path=AdornedElement.(Validation.Errors).CurrentItem.ErrorContent, ElementName=adorner, FallbackValue=What}"
- Foreground="{DynamicResource WindowTitleForegroundColorBrush}" Margin="8,3,8,3" TextWrapping="Wrap"/>
- </Border>
- </Popup>
- </StackPanel>
- </ControlTemplate>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement