Uwp Usercontrol无法在Universal Windows Phone中获取ResourceDictionary

Uwp Usercontrol无法在Universal Windows Phone中获取ResourceDictionary,uwp,Uwp,我有一个资源字典,我根据下面的代码在App.xaml中引用了它,它可以正常工作,但我在UserControl.xaml中给出的代码不起作用 <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/Tutorials/Controls/C

我有一个资源字典,我根据下面的代码在App.xaml中引用了它,它可以正常工作,但我在UserControl.xaml中给出的代码不起作用

 <Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Tutorials/Controls/CustomColumnChooserTheme.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>


你能就此提出建议吗?

我检查过了,一切都会好起来的

如果UserControl位于主项目文件夹中,只需将以下XAML代码添加到UserControl:

<UserControl.Resources>
  <ResourceDictionary>
     <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Tutorials/Controls/CustomColumnChooserTheme.xaml" />
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</UserControl.Resources>


可能路径错误?这不应该是相对的吗?源是一个Uri-尝试添加
。/您的相对路径
-或者使用
ms-appx:///...
schema。路径正确,我尝试了ms-appx:///Tutorials/Controls/CustomColumnChooserTheme.xaml 和.././Tutorials/Controls/CustomColumnChooserTheme.xaml,但不起作用