-
Notifications
You must be signed in to change notification settings - Fork 710
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
Corner radius not set for ContentDialog and its buttons in 1803 #1779
Comments
I think this should be fixed by #1405 as Ranjesh mentioned. I tested on 1803 vm with the same configurations and it looked fine. @harvinders did you re-template the ContentDialog by any chance? Or were there any special configurations you did but not included in the repro steps ? |
Fixed by #1405 |
@kaiguo I did a little bit more investigation and found the issue only comes when we create a public sealed partial class CustomDialog : ContentDialog
{
} <ContentDialog
x:Class="MyViews.CustomDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
Title="Title"
MinWidth="600"
PrimaryButtonText="Primary"
SecondaryButtonText="Secondary"
CloseButtonText="Close">
<Grid x:Name="ContentArea" >
<Grid.RowDefinitions>
<RowDefinition x:Name="TitleRow" Height="Auto" />
<RowDefinition Height="10" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<AutoSuggestBox QueryIcon="Find" />
...
</Grid>
</ContentDialog> var customDialog = new CustomDialog()
await customDialog.ShowAsync(); However, if we simply create a Dialog using following code, rounded corner shows up properly. var simpleDialog = new ContentDialog()
{
Title = "Hello",
PrimaryButtonText = "Primary"
};
await simpleDialog.ShowAsync(); |
@kaiguo <ContentDialog.Resources>
<Style TargetType="local:CustomDialog" BasedOn="{StaticResource DefaultContentDialogStyle}" />
</ContentDialog.Resources> But I feel one should not have to do it. |
@kaiguo, Is this a ContentDialog specific issue or a more generic framework issue that affects all derived controls ? If it is not a more common issue, what in ContentDialog is causing this ? |
Yeah I think you have to do the "BasedOn" trick, otherwise it will use styles from the hosting OS, which doesn't have rounded corners. |
Describe the bug
Rounded corner is not shown for the
ContentDialog
and the buttons (primary, secondary and close) inside.Steps to reproduce the bug
Steps to reproduce the behavior:
ContentDialog
Expected behavior
Corner radius for buttons and the dialog
Screenshots
Version Info
NuGet package version:
Microsoft.UI.Xaml 2.4.0-prerelease.191217001
Additional context
The text was updated successfully, but these errors were encountered: