Skip to content

Commit

Permalink
Fix issue with ContentDialog not respecting BorderThickness property …
Browse files Browse the repository at this point in the history
…set (#2664)

* Fix issue with ContentDialog not respecting BorderThickness property set

* Update visual tree verification files
  • Loading branch information
marcelwgn authored Jun 18, 2020
1 parent 7897a6a commit a0f4581
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion dev/ContentDialog/ContentDialog_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
<Style x:Key="DefaultContentDialogStyle" TargetType="ContentDialog">
<Setter Property="Foreground" Value="{ThemeResource ContentDialogForeground}" />
<Setter Property="Background" Value="{ThemeResource ContentDialogBackground}" />
<Setter Property="BorderThickness" Value="{ThemeResource ContentDialogBorderWidth}" />
<Setter Property="BorderBrush" Value="{ThemeResource ContentDialogBorderBrush}" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="PrimaryButtonStyle" Value="{ThemeResource DefaultButtonStyle}" />
Expand Down Expand Up @@ -276,7 +277,7 @@
x:Name="BackgroundElement"
Background="{TemplateBinding Background}"
FlowDirection="{TemplateBinding FlowDirection}"
BorderThickness="{ThemeResource ContentDialogBorderWidth}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
contract7Present:CornerRadius="{TemplateBinding CornerRadius}"
contract7NotPresent:CornerRadius="{ThemeResource OverlayCornerRadius}"
Expand Down
2 changes: 1 addition & 1 deletion dev/ContentDialog/TestUI/ContentDialogPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="12">
<Button Content="Click to open simple ContentDialog" Click="ShowDialog_Click"/>
<Button Content="Border thickness test dialog" Click="ShowBorderThickness_Click"/>
</StackPanel>
</local:TestPage>
15 changes: 15 additions & 0 deletions dev/ContentDialog/TestUI/ContentDialogPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;

namespace MUXControlsTestApp
{
Expand All @@ -19,5 +21,18 @@ private void ShowDialog_Click(object sender, RoutedEventArgs e)
var dialog = new ContentDialog { Title = "Title", Content = "Content", IsPrimaryButtonEnabled = true, PrimaryButtonText = "PrimaryButton", SecondaryButtonText = "SecondaryButton", CloseButtonText = "CloseButton" };
_ = dialog.ShowAsync();
}

private void ShowBorderThickness_Click(object sender, RoutedEventArgs e)
{
var dialog = new ContentDialog {
Title = "Title",
Content = "I am testing border thickness",
IsPrimaryButtonEnabled = true,
BorderThickness = new Thickness(10, 20, 10, 20),
CloseButtonText = "CloseButton",
BorderBrush = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0))
};
_ = dialog.ShowAsync();
}
}
}
2 changes: 1 addition & 1 deletion test/MUXControlsTestApp/master/ContentDialog-5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[Windows.UI.Xaml.Controls.ContentDialog]
Padding=0,0,0,0
Foreground=#FF000000
BorderThickness=0,0,0,0
BorderThickness=1,1,1,1
BorderBrush=#33000000
Background=#FFF2F2F2
Margin=0,0,0,0
Expand Down
2 changes: 1 addition & 1 deletion test/MUXControlsTestApp/master/ContentDialog-7.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[Windows.UI.Xaml.Controls.ContentDialog]
Padding=0,0,0,0
Foreground=#FF000000
BorderThickness=0,0,0,0
BorderThickness=1,1,1,1
BorderBrush=#33000000
Background=#FFFFFFFF
CornerRadius=4,4,4,4
Expand Down
2 changes: 1 addition & 1 deletion test/MUXControlsTestApp/master/ContentDialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[Windows.UI.Xaml.Controls.ContentDialog]
Padding=0,0,0,0
Foreground=#FF000000
BorderThickness=0,0,0,0
BorderThickness=1,1,1,1
BorderBrush=#33000000
Background=#FFF2F2F2
MaxWidth=548
Expand Down

0 comments on commit a0f4581

Please sign in to comment.