-
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
Bug: ContentDialog is changing the application-scope default button style (setting BorderBrush) #1764
Comments
@yaichenbaum I believe you mentioned in the past you use the CloseRequested event to open a content dialog prompting the user what to do with any unsaved changes. If you have a chance, and you think it's worth your time, could you see if this appears in your app? |
@robloo I am using custom buttons in the dialog, so I don't see this behavior. |
@yaichenbaum, Ok, thanks a lot for taking a look. |
@robloo thank you for reporting this bug. Can you provide a repro app to help us investigate? |
@YuliKl Thanks for your response. It's likely I'm missing something in the steps to reproduce but I don't have a lot of time to spend on this at the moment. So I'll see if I can provide more details but can't guarantee a repro app at the moment. |
@YuliKl After going through the styles I found two lines that were not deleted when migrating to WinUI 2.3 (see So that means most of, if not all of, this was a bug on my part. The question that is keeping me from closing this right now is why don't my border customizations always show? Why does it take the ContentDialog to make them appear? Something was either changed with styling precedence I don't understand or there is possibly still a bug some place. (At this point I'm thinking it's my mistake again). Screen ShotSource Code |
@robloo glad to hear that you were able to solve most of the problem.
@MikeHillberg any ideas about these questions? |
@robloo could you provide the app you used to make this gif? It would help a lot for our debugging purposes. |
Hi @StephenLPeters, thanks for taking a look at this. The source code is in the zip file at the bottom of my last post -- sorry it's a bit hard to see. |
Oh awesome! I totally missed that, thank you! |
This should be a bug on application side according to #1345 (comment), closing. |
@kaiguo This is NOT the same as #1345. Per my comments above, yes, I'm changing the style of the button. However, why doesn't the custom border always appear on the button? Why does it only show up after the ContentDialog is opened? There may be a bug still in the framework. Please re-open this or provide an explanation for:
|
@StephenLPeters Seems like a framework issue, so it probably needs WinUI 3. |
I'm not sure where the issue is, it could be a framework issue, but it could also be a weird by design quirk with how the app is importing the winui 2 package.. I think this could be looked into more before we push it to winui 3, however I don't think we have the resources. |
I certainly agree there is no need to look at this before WinUI 3.0. Let's wait until WinUI 3.0 is solid and then I can test again to see if it has been fixed. I expect it is a strange case that might just disappear by then. |
I'm closing this because I don't care to check if it still exists in WinUI3. It wasn't a critical issue (although indicated some fundamental flaws in styling) and someone else can bring it up in the future if it still exists. |
Describe the bug
Opening a ContentDialog will change the application-scope default button style and add a border brush that wasn't previously there. The application will now be using the modified button style until it is restarted.
This initially appeared related to #1405 which had content dialog styling fixes for Bug: CornerRadius Inconsistency/Missing in ContentDialog/MessageDialog #1345. However, that no longer appears to be true.
Steps to reproduce the bug
Edit: This is more complex than it initially appeared. Even when reverting from WinUI 2.3 back to 2.2 it still was present. Then it became apparent:
Expected behavior
The ContentDialog should not modify the application-scoped default button style in any way.
Screenshots
Normal Button Style:
Button Style after ContentDialog is opened then closed:
Version Info
Microsoft.UI.Xaml 2.3.191211002
Desktop Windows 10 Home 1903
The text was updated successfully, but these errors were encountered: