WinUI - defualt style

AT_ 21 Reputation points
2022-09-04T08:41:36.203+00:00

Hello,

My app.xaml has the following:

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

The second bold line override the first bold line - the first line does not change the value. if I don't use the second bold line, other stuff fail (without exact error details- only parsing error) but I need to change the default style.
can you please help?
Thanks,

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.
725 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 81,636 Reputation points
    2022-09-04T09:43:01.427+00:00

    It works for me (Windows App SDK 1.1.0, Windows 10 21H1) with :

     <Application.Resources>  
            <ResourceDictionary>  
                <ResourceDictionary.MergedDictionaries>  
                    <!--<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />-->  
                    <!-- Other merged dictionaries here -->  
                    <XamlControlsResources>  
                        <XamlControlsResources.MergedDictionaries>  
                            <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />  
                            <ResourceDictionary>  
                                <x:Double x:Key="ContentDialogMaxWidth">1400</x:Double>  
                            </ResourceDictionary>  
                        </XamlControlsResources.MergedDictionaries>  
                    </XamlControlsResources>  
                </ResourceDictionary.MergedDictionaries>  
                <!-- Other app resources here -->             
            </ResourceDictionary>  
        </Application.Resources>  
    
    0 comments No comments

0 additional answers

Sort by: Most helpful