Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.86 KB | None | 0 0
  1.  
  2. <ControlTemplate x:Key="ErrorTemplateSilverlightStyle">
  3. <StackPanel Orientation="Horizontal" d:DesignWidth="208.75" d:DesignHeight="22.373">
  4. <i:Interaction.Triggers>
  5. <i:EventTrigger>
  6. <ei:GoToStateAction StateName="StringHidden" UseTransitions="False"/>
  7. </i:EventTrigger>
  8. </i:Interaction.Triggers>
  9. <VisualStateManager.VisualStateGroups>
  10. <VisualStateGroup x:Name="ErrorStringVisibility">
  11. <VisualStateGroup.Transitions>
  12. <VisualTransition GeneratedDuration="0:0:0.2">
  13. <VisualTransition.GeneratedEasingFunction>
  14. <CubicEase EasingMode="EaseOut"/>
  15. </VisualTransition.GeneratedEasingFunction>
  16. </VisualTransition>
  17. <VisualTransition From="StringHidden" GeneratedDuration="0:0:0.2" To="StringVisible">
  18. <VisualTransition.GeneratedEasingFunction>
  19. <CubicEase EasingMode="EaseOut"/>
  20. </VisualTransition.GeneratedEasingFunction>
  21. <Storyboard>
  22. <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.IsOpen)" Storyboard.TargetName="popup">
  23. <DiscreteBooleanKeyFrame KeyTime="0" Value="True"/>
  24. </BooleanAnimationUsingKeyFrames>
  25. <DoubleAnimation Duration="0:0:0.2" From="-50" Storyboard.TargetProperty="(Popup.HorizontalOffset)" Storyboard.TargetName="popup">
  26. <DoubleAnimation.EasingFunction>
  27. <CubicEase EasingMode="EaseOut"/>
  28. </DoubleAnimation.EasingFunction>
  29. </DoubleAnimation>
  30. </Storyboard>
  31. </VisualTransition>
  32. <VisualTransition From="StringVisible" GeneratedDuration="0:0:0.2" To="StringHidden">
  33. <VisualTransition.GeneratedEasingFunction>
  34. <CubicEase EasingMode="EaseOut"/>
  35. </VisualTransition.GeneratedEasingFunction>
  36. <Storyboard>
  37. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.HorizontalOffset)" Storyboard.TargetName="popup">
  38. <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
  39. <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="-50">
  40. <EasingDoubleKeyFrame.EasingFunction>
  41. <CubicEase EasingMode="EaseOut"/>
  42. </EasingDoubleKeyFrame.EasingFunction>
  43. </EasingDoubleKeyFrame>
  44. </DoubleAnimationUsingKeyFrames>
  45. <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.IsOpen)" Storyboard.TargetName="popup">
  46. <DiscreteBooleanKeyFrame KeyTime="0" Value="True"/>
  47. <DiscreteBooleanKeyFrame KeyTime="0:0:0.2" Value="False"/>
  48. </BooleanAnimationUsingKeyFrames>
  49. </Storyboard>
  50. </VisualTransition>
  51. </VisualStateGroup.Transitions>
  52. <VisualState x:Name="StringHidden">
  53. <Storyboard>
  54. <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.IsOpen)" Storyboard.TargetName="popup">
  55. <DiscreteBooleanKeyFrame KeyTime="0" Value="False"/>
  56. </BooleanAnimationUsingKeyFrames>
  57. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="errorBorder">
  58. <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
  59. </DoubleAnimationUsingKeyFrames>
  60. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.HorizontalOffset)" Storyboard.TargetName="popup">
  61. <EasingDoubleKeyFrame KeyTime="0" Value="50"/>
  62. </DoubleAnimationUsingKeyFrames>
  63. </Storyboard>
  64. </VisualState>
  65. <VisualState x:Name="StringVisible">
  66. <Storyboard>
  67. <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(Popup.IsOpen)" Storyboard.TargetName="popup">
  68. <DiscreteBooleanKeyFrame KeyTime="0" Value="True"/>
  69. </BooleanAnimationUsingKeyFrames>
  70. </Storyboard>
  71. </VisualState>
  72. </VisualStateGroup>
  73. </VisualStateManager.VisualStateGroups>
  74. <Border BorderThickness="2" BorderBrush="{DynamicResource ErrorColor}"
  75. VerticalAlignment="Top" Background="{x:Null}" Margin="0" Padding="0">
  76. <i:Interaction.Triggers>
  77. <i:EventTrigger EventName="MouseEnter">
  78. <ei:GoToStateAction StateName="StringVisible"/>
  79. </i:EventTrigger>
  80. <i:EventTrigger EventName="MouseLeave">
  81. <ei:GoToStateAction StateName="StringHidden"/>
  82. </i:EventTrigger>
  83. </i:Interaction.Triggers>
  84. <Grid Margin="0" Visibility="Visible">
  85. <AdornedElementPlaceholder x:Name="adorner" Visibility="Visible"/>
  86. <StackPanel Margin="0" Orientation="Horizontal" HorizontalAlignment="Right" Background="#00000000" Visibility="Visible">
  87. <Path Data="M0,0 L100,0 100,28.373333 z" Fill="{DynamicResource ErrorColor}" Stretch="Fill" Width="16" Visibility="Collapsed" Margin="0"/>
  88. <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">
  89. <ed:RegularPolygon.RenderTransform>
  90. <TransformGroup>
  91. <ScaleTransform/>
  92. <SkewTransform/>
  93. <RotateTransform Angle="180"/>
  94. <TranslateTransform/>
  95. </TransformGroup>
  96. </ed:RegularPolygon.RenderTransform>
  97. </ed:RegularPolygon>
  98. <Border BorderBrush="{x:Null}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Background="{DynamicResource ErrorColor}" Margin="0" Visibility="Visible">
  99. <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">
  100. <Path.RenderTransform>
  101. <TransformGroup>
  102. <ScaleTransform/>
  103. <SkewTransform/>
  104. <RotateTransform/>
  105. <TranslateTransform/>
  106. </TransformGroup>
  107. </Path.RenderTransform>
  108. </Path>
  109. </Border>
  110. </StackPanel>
  111. </Grid>
  112. </Border>
  113. <Popup x:Name="popup" Placement="Right" Width="Auto" AllowsTransparency="True" StaysOpen="True" RenderTransformOrigin="0.5,0.5" IsHitTestVisible="False" VerticalAlignment="Center">
  114. <Popup.RenderTransform>
  115. <TransformGroup>
  116. <ScaleTransform/>
  117. <SkewTransform/>
  118. <RotateTransform/>
  119. <TranslateTransform/>
  120. </TransformGroup>
  121. </Popup.RenderTransform>
  122. <Border x:Name="errorBorder" Background="{DynamicResource ErrorColor}" Margin="0,0,5,5"
  123. Opacity="1"
  124. IsHitTestVisible="False"
  125. MinHeight="24" MaxWidth="267" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center">
  126. <Border.RenderTransform>
  127. <TransformGroup>
  128. <ScaleTransform/>
  129. <SkewTransform/>
  130. <RotateTransform/>
  131. <TranslateTransform X="0"/>
  132. </TransformGroup>
  133. </Border.RenderTransform>
  134. <Border.Effect>
  135. <DropShadowEffect ShadowDepth="4"
  136. Color="Black"
  137. Opacity="0.4"
  138. Direction="315"
  139. BlurRadius="4"/>
  140. </Border.Effect>
  141. <TextBlock Text="{Binding Path=AdornedElement.(Validation.Errors).CurrentItem.ErrorContent, ElementName=adorner, FallbackValue=What}"
  142. Foreground="{DynamicResource WindowTitleForegroundColorBrush}" Margin="8,3,8,3" TextWrapping="Wrap"/>
  143. </Border>
  144. </Popup>
  145. </StackPanel>
  146. </ControlTemplate>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement