-
I have base.props file: <?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)AppHead.xaml" />
<ApplicationDefinition
Include="$(MSBuildThisFileDirectory)AppHead.xaml"
SubType="Designer"
XamlRuntime="WinUI"
Generator="MSBuild:Compile"
Link="AppHead.xaml" />
<Compile
Include="$(MSBuildThisFileDirectory)AppHead.xaml.cs"
XamlRuntime="WinUI"
DependentUpon="AppHead.xaml"
Link="AppHead.xaml.cs" />
</ItemGroup>
</Project> And also I have AppHead.xaml file such as this example: <local:App x:Class="Ligric.UI.AppHead" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Ligric.UI">
<local:App.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Ligric.UI/AppResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</local:App.Resources>
</local:App> I'am tying to add a style reference to my AppResources: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Styles/test.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary> My test.xaml (just an empty file for test): <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</ResourceDictionary> The message:
If I'll comment this line <!--ResourceDictionary Source="ms-appx:///Styles/test.xaml"--/> the issue is disappearing. The test repository: https://github.com/limeniye/BasePropsWithStyleResourceDictionary |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Thanks for the report. You'll need to explicitly specify the assembly name when referencing a ResourceDictionary in |
Beta Was this translation helpful? Give feedback.
@jeromelaban , thanks. Yes, its need to set Page build but I did it only for AppResources. Thats was my mistake.