question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Visual Studio ContentDialog template creates dialog with old uwp styles (non WinUI 2.6)

See original GitHub issue

Describe the bug If you create custom ContentDialog with VS template then you can see old UWP styles instead of new WinUI 2.6 styles.

Steps to reproduce the bug

  1. Open Project
  2. Create ContentDialog with VS template in separated file
  3. Call ShowAsync:
new SomeContentDialogClass().ShowAsync();
  1. See old ContentDialog styles.

Expected behavior ContentDialog must show new WinUI 2.6 styles

Screenshots

Custom ContentDialog image

ContentDialog created with this code:

new ContentDialog().ShowAsync();

image

Version Info WinUI 2.6

NuGet package version: [Microsoft.UI.Xaml 2.6.0]

Windows app type:

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
crramirezcommented, Jul 21, 2021

Hello @StephenLPeters ,

More context: https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.contentdialog?view=winrt-20348#derived-controls-with-winui-styles image

VisualStudio templates for create ContentDialog, creates a derived control without WinUI styles

Yesterday I had to add this to all of my dialogs that were created with VS templates

Regards

1reaction
StephenLPeterscommented, Jul 28, 2021

Sure, @anawishnoff FYI

Read more comments on GitHub >

github_iconTop Results From Across the Web

ContentDialog Class (Windows.UI.Xaml.Controls)
Represents a dialog box that can be customized to contain checkboxes, hyperlinks, buttons and any other XAML content.
Read more >
ContentDialog won't use any default style in UWP #5119
Open XAML Controls Gallery. Search for ContentDialog and click on Show dialog . Notice the dialog using UWP style rather than WinUI style....
Read more >
win universal app - customizing ContentDialog in UWP
You can create a custom Style for the ContentDialog , the default template is here: ...
Read more >
Showing a Dialog in Uno Platform and WinUI - YouTube
In this short video we will show a dialog prompt in Uno Platform / WinUI with C# and .NET. If you have suggestions...
Read more >
uwp dialog size - Developer Community
Hi , i use a custom content dialog very simple in uwp and since i try to put a bit of margin it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found