简体   繁体   中英

MergedDictionaries nightmare

I'm trying to use a WPF Template and I'm supposed to include this in my App.xaml, but I get "Nested properties are not supported: ResourceDictionaries.MergedDictionaries" error and "The attachable property "MergedDictionaries" was not found in type "ResourceDictionary".

 <Application x:Class="Unico.App"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

                 StartupUri="MainWindow.xaml">
        <Application.Resources>
            <ResourceDictionary.MergedDictionaries>

                <!-- Set default skin -->
                <ResourceDictionary Source="\ExpressionDark.xaml"/>
                <ResourceDictionary Source="\WindowStyle.xaml"/>


            </ResourceDictionary.MergedDictionaries>

            <Style TargetType="{x:Type Rectangle}" />

        </Application.Resources>
    </Application>

I've tried everything but still can't fix this. Any idea? Thanks.

MergedDictionaries is a property of ResourceDictionary. Change to:

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
            ...
            </ResourceDictionary.MergedDictionaries>
            <Style TargetType="{x:Type Rectangle}" />
        </ResourceDictionary>
    </Application.Resources>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM