Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with ContentDialog not respecting BorderThickness property set #2664

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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