Skip to content

Commit e752eb3

Browse files
ismaelestalayomichael-hawker
authored andcommitted
fixed button size and position
1 parent 3c394d9 commit e752eb3

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/InAppNotification/InAppNotificationXaml.bind

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,13 @@
4040
<VisualState x:Name="Normal" />
4141
<VisualState x:Name="PointerOver">
4242
<Storyboard>
43-
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
44-
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlMSEdgeNotificationPointerOverForegroundBrush}" />
45-
</ObjectAnimationUsingKeyFrames>
4643
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background">
47-
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlMSEdgeNotificationPointerOverChromeBrush}" />
44+
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}" />
4845
</ObjectAnimationUsingKeyFrames>
4946
</Storyboard>
5047
</VisualState>
5148
<VisualState x:Name="Pressed">
5249
<Storyboard>
53-
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text" Storyboard.TargetProperty="Foreground">
54-
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlMSEdgeNotificationPointerOverForegroundBrush}" />
55-
</ObjectAnimationUsingKeyFrames>
5650
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background">
5751
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SystemControlMSEdgeNotificationPointerOverChromeBrush}" />
5852
</ObjectAnimationUsingKeyFrames>
@@ -236,39 +230,42 @@
236230

237231
<Button x:Name="OkButton"
238232
Margin="0"
239-
FontSize="16"
233+
FontSize="14"
240234
Content="Ok"
241-
Height="40"
242-
Width="120"
235+
Height="30"
236+
Width="100"
243237
Command="{StaticResource DismissCommand}"
244238
CommandParameter="{Binding ElementName=ExampleInAppNotification}"
245239
AutomationProperties.Name="Ok" />
246240

247241
<Button x:Name="CancelButton"
248242
Margin="4,0,0,0"
249-
FontSize="16"
243+
FontSize="14"
250244
Content="Cancel"
251-
Height="40"
252-
Width="120"
245+
Height="30"
246+
Width="100"
253247
Command="{StaticResource DismissCommand}"
254248
CommandParameter="{Binding ElementName=ExampleInAppNotification}"
255249
AutomationProperties.Name="Cancel"/>
256250

257251
</StackPanel>
258252

259253
<Button x:Name="DismissButton"
254+
CornerRadius="2"
260255
Grid.Column="2"
261-
Margin="4,0,0,0"
262-
FontSize="16"
256+
Margin="0 0 2 0"
257+
FontSize="12"
258+
Height="43" Width="48"
263259
Style="{StaticResource DismissTextBlockButtonStyle}"
264260
Content="&#xE894;"
265261
FontFamily="Segoe MDL2 Assets"
266262
AutomationProperties.Name="Dismiss"
267263
Command="{StaticResource DismissCommand}"
268264
CommandParameter="{Binding ElementName=ExampleInAppNotification}"
265+
VerticalAlignment="Center"
269266
Visibility="{Binding ShowDismissButton, ElementName=ExampleCustomInAppNotification}">
270267
<Button.RenderTransform>
271-
<TranslateTransform x:Name="DismissButtonTransform" X="18" />
268+
<TranslateTransform x:Name="DismissButtonTransform" X="25" Y="-5"/>
272269
</Button.RenderTransform>
273270
</Button>
274271
</Grid>
@@ -342,13 +339,19 @@
342339
TextWrapping="WrapWholeWords" />
343340

344341
<Button x:Name="PART_DismissButton"
345-
Grid.Column="1"
342+
CornerRadius="20" Height="43" Width="48"
343+
Grid.Column="1"
344+
VerticalAlignment="Top"
346345
Visibility="{Binding ShowDismissButton, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
347-
FontSize="16"
346+
FontSize="12"
348347
Style="{StaticResource DismissTextBlockButtonStyle}"
349-
Content="&#xE894;"
350-
FontFamily="Segoe MDL2 Assets"
351-
AutomationProperties.Name="Dismiss" />
348+
Content="&#xE894;"
349+
FontFamily="Segoe MDL2 Assets"
350+
AutomationProperties.Name="Dismiss">
351+
<Button.RenderTransform>
352+
<TranslateTransform x:Name="DismissButtonTransform" X="25" Y="-7"/>
353+
</Button.RenderTransform>
354+
</Button>
352355
</Grid>
353356
</controls:DropShadowPanel>
354357
</Grid>

Microsoft.Toolkit.Uwp.UI.Controls.Core/InAppNotification/Styles/MSEdgeNotificationStyle.xaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@
7575
</VisualState>
7676
<VisualState x:Name="Pressed">
7777
<Storyboard>
78-
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text"
79-
Storyboard.TargetProperty="Foreground">
80-
<DiscreteObjectKeyFrame KeyTime="0"
81-
Value="{ThemeResource SystemControlMSEdgeNotificationPointerPressedForegroundBrush}" />
82-
</ObjectAnimationUsingKeyFrames>
8378
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
8479
Storyboard.TargetProperty="Background">
8580
<DiscreteObjectKeyFrame KeyTime="0"
@@ -133,10 +128,11 @@
133128

134129
<Grid.ColumnDefinitions>
135130
<ColumnDefinition Width="*" />
136-
<ColumnDefinition Width="Auto" />
131+
<ColumnDefinition Width="40" />
137132
</Grid.ColumnDefinitions>
138133

139134
<ContentPresenter x:Name="PART_Presenter"
135+
Grid.Column="0"
140136
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
141137
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
142138
HorizontalContentAlignment="Stretch"
@@ -146,16 +142,17 @@
146142
TextWrapping="WrapWholeWords" />
147143

148144
<Button x:Name="PART_DismissButton"
145+
CornerRadius="2"
149146
Grid.Column="1"
150147
Margin="0"
151148
AutomationProperties.Name="Dismiss"
152149
Content="&#xE894;"
153150
FontFamily="Segoe MDL2 Assets"
154151
FontSize="12"
155-
VerticalAlignment="{StaticResource SystemControlMSEdgeNotificationDismissButtonVerticalAlignment}"
152+
VerticalAlignment="Top"
156153
Style="{StaticResource DismissTextBlockButtonStyle}">
157154
<Button.RenderTransform>
158-
<TranslateTransform x:Name="DismissButtonTransform" X="18" Y="-8"/>
155+
<TranslateTransform x:Name="DismissButtonTransform" X="25" Y="-5"/>
159156
</Button.RenderTransform>
160157
</Button>
161158
</Grid>

0 commit comments

Comments
 (0)