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

Corner radius not set for ContentDialog and its buttons in 1803 #1779

Closed
harvinders opened this issue Dec 19, 2019 · 8 comments
Closed

Corner radius not set for ContentDialog and its buttons in 1803 #1779

harvinders opened this issue Dec 19, 2019 · 8 comments
Assignees
Labels
area-Dialogs duplicate This issue or pull request already exists needs-assignee-attention Assignee needs to follow-up or investigate this issue team-Controls Issue for the Controls team

Comments

@harvinders
Copy link

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:

  1. Create a blank UWP app using visual studio 2019
  2. Set the target to 1903 and min target to 1803
  3. Include the Microsoft.UI.Xaml prerelease package
  4. Make the neccessary resource dictionary change in app.xaml
  5. Invoke a ContentDialog
  6. Run on 1803

Expected behavior
Corner radius for buttons and the dialog

Screenshots

image

Version Info

NuGet package version:
Microsoft.UI.Xaml 2.4.0-prerelease.191217001

Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134) Yes
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Mobile
Xbox
Surface Hub
IoT

Additional context

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Dec 19, 2019
@robloo
Copy link
Contributor

robloo commented Dec 20, 2019

Related to #1345 and #1405

@ranjeshj ranjeshj added area-Dialogs team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Dec 20, 2019
@ranjeshj
Copy link
Contributor

@kaiguo can you please check if this is resolved by your fix ?#1405

@kaiguo
Copy link
Contributor

kaiguo commented Dec 20, 2019

I think this should be fixed by #1405 as Ranjesh mentioned. I tested on 1803 vm with the same configurations and it looked fine.

WeChat Screenshot_20191220125006

@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 ?

@kaiguo kaiguo added the needs-author-feedback Asked author to supply more information. label Dec 20, 2019
@ranjeshj ranjeshj added the duplicate This issue or pull request already exists label Dec 20, 2019
@ranjeshj
Copy link
Contributor

Fixed by #1405

@harvinders
Copy link
Author

@kaiguo I did a little bit more investigation and found the issue only comes when we create a derived ContentDialog. I should have explicitly mentioned it.

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();

@msft-github-bot msft-github-bot added needs-triage Issue needs to be triaged by the area owners needs-assignee-attention Assignee needs to follow-up or investigate this issue and removed needs-author-feedback Asked author to supply more information. labels Dec 21, 2019
@harvinders
Copy link
Author

@kaiguo
The work around is setting the Style for my CustomDialog

<ContentDialog.Resources>
  <Style TargetType="local:CustomDialog" BasedOn="{StaticResource DefaultContentDialogStyle}" />
</ContentDialog.Resources>

But I feel one should not have to do it.

@ranjeshj
Copy link
Contributor

ranjeshj commented Jan 2, 2020

@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 ?

@msft-github-bot msft-github-bot removed the needs-triage Issue needs to be triaged by the area owners label Jan 2, 2020
@ranjeshj ranjeshj reopened this Jan 2, 2020
@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Jan 2, 2020
@ranjeshj ranjeshj removed the needs-triage Issue needs to be triaged by the area owners label Jan 2, 2020
@kaiguo
Copy link
Contributor

kaiguo commented Jan 28, 2020

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.

@kaiguo kaiguo closed this as completed Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Dialogs duplicate This issue or pull request already exists needs-assignee-attention Assignee needs to follow-up or investigate this issue team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

5 participants