WinUI3 ContentDialogMaxWidth Not Working

Poramin 0 Reputation points
2023-07-24T02:57:32.5+00:00

I followed the example provided, but it still doesn't work. The size remains at 548 as before. However, if I remove the XamlControlsResources, I can set the ContentDialogMaxWidth, but doing so might cause a bug later.

 <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
            </ResourceDictionary.MergedDictionaries>
            <x:Double x:Key="ContentDialogMaxWidth">1200</x:Double>
        </ResourceDictionary>
    </Application.Resources>

Size Dialogimage

If I remove the part that says "using: Microsoft.UI.Xaml.Controls"

<Application.Resources>
        <ResourceDictionary>
            <x:Double x:Key="ContentDialogMaxWidth">1200</x:Double>
        </ResourceDictionary>
    </Application.Resources>

I will get the desired size. But there are some bugs.
User's image

WinUI3
Windows App SDK : 1.3.230602002

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
693 questions
{count} votes