|
18 | 18 |
|
19 | 19 | <local:DismissCommand x:Key="DismissCommand" /> |
20 | 20 |
|
21 | | - <ControlTemplate x:Key="MSEdgeNotificationTemplate_NoDismissButton"> |
22 | | - <Grid> |
23 | | - <VisualStateManager.VisualStateGroups> |
24 | | - <VisualStateGroup x:Name="State"> |
25 | | - <VisualState x:Name="Collapsed"> |
26 | | - <Storyboard> |
27 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" |
28 | | - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> |
29 | | - <EasingDoubleKeyFrame KeyTime="0" Value="0" /> |
30 | | - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" |
31 | | - Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> |
32 | | - </DoubleAnimationUsingKeyFrames> |
| 21 | + <Style TargetType="controls:InAppNotification" x:Key="MSEdgeNotificationTemplate_NoDismissButton"> |
| 22 | + <Setter Property="Template"> |
| 23 | + <Setter.Value> |
| 24 | + <ControlTemplate> |
| 25 | + <Grid> |
| 26 | + <VisualStateManager.VisualStateGroups> |
| 27 | + <VisualStateGroup x:Name="State"> |
| 28 | + <VisualState x:Name="Collapsed"> |
| 29 | + <Storyboard> |
| 30 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" |
| 31 | + Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> |
| 32 | + <EasingDoubleKeyFrame KeyTime="0" Value="0" /> |
| 33 | + <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" |
| 34 | + Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> |
| 35 | + </DoubleAnimationUsingKeyFrames> |
33 | 36 |
|
34 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" |
35 | | - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> |
36 | | - <EasingDoubleKeyFrame KeyTime="0" Value="0" /> |
37 | | - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" |
38 | | - Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}"/> |
39 | | - </DoubleAnimationUsingKeyFrames> |
| 37 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" |
| 38 | + Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> |
| 39 | + <EasingDoubleKeyFrame KeyTime="0" Value="0" /> |
| 40 | + <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" |
| 41 | + Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}"/> |
| 42 | + </DoubleAnimationUsingKeyFrames> |
40 | 43 |
|
41 | | - <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" |
42 | | - Storyboard.TargetProperty="(UIElement.Visibility)"> |
43 | | - <DiscreteObjectKeyFrame KeyTime="0"> |
44 | | - <DiscreteObjectKeyFrame.Value> |
45 | | - <Visibility>Visible</Visibility> |
46 | | - </DiscreteObjectKeyFrame.Value> |
47 | | - </DiscreteObjectKeyFrame> |
48 | | - <DiscreteObjectKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"> |
49 | | - <DiscreteObjectKeyFrame.Value> |
50 | | - <Visibility>Collapsed</Visibility> |
51 | | - </DiscreteObjectKeyFrame.Value> |
52 | | - </DiscreteObjectKeyFrame> |
53 | | - </ObjectAnimationUsingKeyFrames> |
54 | | - </Storyboard> |
55 | | - </VisualState> |
| 44 | + <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" |
| 45 | + Storyboard.TargetProperty="(UIElement.Visibility)"> |
| 46 | + <DiscreteObjectKeyFrame KeyTime="0"> |
| 47 | + <DiscreteObjectKeyFrame.Value> |
| 48 | + <Visibility>Visible</Visibility> |
| 49 | + </DiscreteObjectKeyFrame.Value> |
| 50 | + </DiscreteObjectKeyFrame> |
| 51 | + <DiscreteObjectKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"> |
| 52 | + <DiscreteObjectKeyFrame.Value> |
| 53 | + <Visibility>Collapsed</Visibility> |
| 54 | + </DiscreteObjectKeyFrame.Value> |
| 55 | + </DiscreteObjectKeyFrame> |
| 56 | + </ObjectAnimationUsingKeyFrames> |
| 57 | + </Storyboard> |
| 58 | + </VisualState> |
56 | 59 |
|
57 | | - <VisualState x:Name="Visible"> |
58 | | - <Storyboard> |
59 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" |
60 | | - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> |
61 | | - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> |
62 | | - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> |
63 | | - </DoubleAnimationUsingKeyFrames> |
| 60 | + <VisualState x:Name="Visible"> |
| 61 | + <Storyboard> |
| 62 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" |
| 63 | + Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"> |
| 64 | + <EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> |
| 65 | + <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> |
| 66 | + </DoubleAnimationUsingKeyFrames> |
64 | 67 |
|
65 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" |
66 | | - Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> |
67 | | - <EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> |
68 | | - <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> |
69 | | - </DoubleAnimationUsingKeyFrames> |
70 | | - </Storyboard> |
71 | | - </VisualState> |
72 | | - </VisualStateGroup> |
73 | | - </VisualStateManager.VisualStateGroups> |
74 | | - <Grid x:Name="RootGrid" |
75 | | - RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" |
76 | | - Margin="{TemplateBinding Margin}" |
77 | | - Padding="{TemplateBinding Padding}" |
78 | | - MaxWidth="{TemplateBinding MaxWidth}" |
79 | | - Visibility="{TemplateBinding Visibility}" |
80 | | - Background="{TemplateBinding Background}" |
81 | | - BorderBrush="{TemplateBinding BorderBrush}" |
82 | | - BorderThickness="{TemplateBinding BorderThickness}"> |
83 | | - <Grid.RenderTransform> |
84 | | - <CompositeTransform /> |
85 | | - </Grid.RenderTransform> |
| 68 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" |
| 69 | + Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"> |
| 70 | + <EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" /> |
| 71 | + <EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" /> |
| 72 | + </DoubleAnimationUsingKeyFrames> |
| 73 | + </Storyboard> |
| 74 | + </VisualState> |
| 75 | + </VisualStateGroup> |
| 76 | + </VisualStateManager.VisualStateGroups> |
| 77 | + <Grid x:Name="RootGrid" |
| 78 | + RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}" |
| 79 | + Margin="{TemplateBinding Margin}" |
| 80 | + Padding="{TemplateBinding Padding}" |
| 81 | + MaxWidth="{TemplateBinding MaxWidth}" |
| 82 | + Visibility="{TemplateBinding Visibility}" |
| 83 | + Background="{TemplateBinding Background}" |
| 84 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 85 | + BorderThickness="{TemplateBinding BorderThickness}"> |
| 86 | + <Grid.RenderTransform> |
| 87 | + <CompositeTransform /> |
| 88 | + </Grid.RenderTransform> |
86 | 89 |
|
87 | | - <Grid.ColumnDefinitions> |
88 | | - <ColumnDefinition Width="*" /> |
89 | | - <ColumnDefinition Width="Auto" /> |
90 | | - </Grid.ColumnDefinitions> |
| 90 | + <Grid.ColumnDefinitions> |
| 91 | + <ColumnDefinition Width="*" /> |
| 92 | + <ColumnDefinition Width="Auto" /> |
| 93 | + </Grid.ColumnDefinitions> |
91 | 94 |
|
92 | | - <ContentPresenter x:Name="PART_Presenter" |
93 | | - HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
94 | | - HorizontalContentAlignment="Stretch" |
95 | | - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
96 | | - VerticalContentAlignment="Center" |
97 | | - TextWrapping="WrapWholeWords" /> |
98 | | - </Grid> |
99 | | - </Grid> |
100 | | - </ControlTemplate> |
| 95 | + <ContentPresenter x:Name="PART_Presenter" |
| 96 | + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
| 97 | + HorizontalContentAlignment="Stretch" |
| 98 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
| 99 | + VerticalContentAlignment="Center" |
| 100 | + TextWrapping="WrapWholeWords" /> |
| 101 | + </Grid> |
| 102 | + </Grid> |
| 103 | + </ControlTemplate> |
| 104 | + </Setter.Value> |
| 105 | + </Setter> |
| 106 | + </Style> |
101 | 107 |
|
102 | 108 | <Style x:Key="DismissTextBlockButtonStyle" TargetType="ButtonBase"> |
103 | 109 | <Setter Property="Background" Value="{ThemeResource HyperlinkButtonBackground}" /> |
|
162 | 168 | <VisualState x:Name="NarrowState"> |
163 | 169 | <VisualState.Setters> |
164 | 170 | <Setter Target="TextBlock.Margin" Value="0" /> |
165 | | - |
| 171 | + |
166 | 172 | <Setter Target="ButtonsStackPanel.(Grid.Row)" Value="1" /> |
167 | 173 | <Setter Target="ButtonsStackPanel.(Grid.Column)" Value="0" /> |
168 | 174 | <Setter Target="ButtonsStackPanel.(Grid.ColumnSpan)" Value="3" /> |
|
229 | 235 | Height="32" |
230 | 236 | Width="100" |
231 | 237 | Command="{StaticResource DismissCommand}" |
232 | | - CommandParameter="{Binding ElementName=ExampleInAppNotification}" |
| 238 | + CommandParameter="{Binding ElementName=ExampleCustomInAppNotification}" |
233 | 239 | AutomationProperties.Name="Ok" /> |
234 | 240 |
|
235 | 241 | <Button x:Name="CancelButton" |
|
239 | 245 | Height="32" |
240 | 246 | Width="100" |
241 | 247 | Command="{StaticResource DismissCommand}" |
242 | | - CommandParameter="{Binding ElementName=ExampleInAppNotification}" |
| 248 | + CommandParameter="{Binding ElementName=ExampleCustomInAppNotification}" |
243 | 249 | AutomationProperties.Name="Cancel"/> |
244 | | - |
245 | 250 | </StackPanel> |
246 | 251 |
|
247 | 252 | <Button x:Name="DismissButton" |
|
255 | 260 | FontFamily="Segoe MDL2 Assets" |
256 | 261 | AutomationProperties.Name="Dismiss" |
257 | 262 | Command="{StaticResource DismissCommand}" |
258 | | - CommandParameter="{Binding ElementName=ExampleInAppNotification}" |
| 263 | + CommandParameter="{Binding ElementName=ExampleCustomInAppNotification}" |
259 | 264 | VerticalAlignment="Center" |
260 | 265 | Visibility="{Binding ShowDismissButton, ElementName=ExampleCustomInAppNotification}"> |
261 | 266 | <Button.RenderTransform> |
|
301 | 306 |
|
302 | 307 | <controls:InAppNotification x:Name="ExampleCustomInAppNotification" |
303 | 308 | Content="This is a test message." |
304 | | - Template="{StaticResource MSEdgeNotificationTemplate_NoDismissButton}" |
| 309 | + Style="{StaticResource MSEdgeNotificationTemplate_NoDismissButton}" |
305 | 310 | ShowDismissButton="@[ShowDismissButton]" |
306 | | - AnimationDuration="@[AnimationDuration:TimeSpan:100:0-5000]" |
307 | | - VerticalOffset="@[VerticalOffset:DoubleSlider:100.0:-200.0-200.0]" |
308 | | - HorizontalOffset="@[HorizontalOffset:DoubleSlider:0.0:-200.0-200.0]" /> |
| 311 | + AnimationDuration="@[AnimationDuration]" |
| 312 | + VerticalOffset="@[VerticalOffset]" |
| 313 | + HorizontalOffset="@[HorizontalOffset]" |
| 314 | + StackMode="@[StackMode]" /> |
309 | 315 |
|
310 | 316 | <controls:InAppNotification x:Name="ExampleVSCodeInAppNotification" |
311 | 317 | Style="{StaticResource VSCodeNotificationStyle}" |
|
0 commit comments