XAML WMC9999此成员“Resources”具有多个项,请使用Items属性

afdcj2ne  于 2022-12-07  发布在  其他
关注(0)|答案(1)|浏览(128)

Well, this is my first project with WinUI and Uno platform. I'm working on a Desktop app with WinUI and want to grant it backwards compatibility with Uno, so this is why I'm sticking to Uno project template.
My problem here is after tweaking a lot of stuff that I have no idea about, I ended up with this error.
Also, I would appreciate a source I could learn all about XAML tags from.
| Severity | Code | Description | Project | File | Line | Suppression | State |
| ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ | ------------ |
| Error | WMC9999 | This Member 'Resources' has more than one item, use the Items property | AppTestUI.Windows | C:\Users\hp.nuget\packages\ microsoft.windowsappsdk\1.1.5\buildTransitive\ Microsoft.UI.Xaml.Markup.Compiler.interop.targets | 476 | | |
| Warning | WMC9999 | This Member 'Resources' has more than one item, use the Items property | AppTestUI.Windows | C:\Users\hp.nuget\packages\ microsoft.windowsappsdk\1.1.5\buildTransitive\ Microsoft.UI.Xaml.Markup.Compiler.interop.targets | 352 | | |

<Application
    x:Class="AppTestUI.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Microsoft.UI.Xaml.Controls"
    xmlns:local="using:AppTestUI"
    xmlns:uen="using:Uno.Extensions.Navigation.UI"
    xmlns:uer="using:Uno.Extensions.Reactive.UI"
    xmlns:toolkit="using:Uno.UI.Toolkit"
    xmlns:um="using:Uno.Material"
    xmlns:utu="using:Uno.Toolkit.UI"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    >

    <Application.Resources>
        <ResourceDictionary>

            <ResourceDictionary.MergedDictionaries>
                <um:MaterialColors xmlns="using:Uno.Material" />
                <um:MaterialFonts xmlns="using:Uno.Material" />
                <um:MaterialResources xmlns="using:Uno.Material" />
                <MaterialToolkitResources xmlns="using:Uno.Toolkit.UI.Material" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
        <controls:XamlControlsResources x:Key="using:Microsoft.UI.Xaml.Controls" />
        <utu:ToolkitResources x:Key="using:Uno.Toolkit.UI" />
    </Application.Resources>
</Application>
fgw7neuy

fgw7neuy1#

试试这个:

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <um:MaterialColors xmlns="using:Uno.Material" />
            <um:MaterialFonts xmlns="using:Uno.Material" />
            <um:MaterialResources xmlns="using:Uno.Material" />
            <MaterialToolkitResources xmlns="using:Uno.Toolkit.UI.Material" />
        </ResourceDictionary.MergedDictionaries>
        <controls:XamlControlsResources x:Key="using:Microsoft.UI.Xaml.Controls" />
        <utu:ToolkitResources x:Key="using:Uno.Toolkit.UI" />
    </ResourceDictionary>
</Application.Resources>

相关问题