Failed to use global StaticResource declared earlier
Posted: 12 Nov 2019, 16:45
Hi, we have come across an issue where we are not sure if this is intended or a bug.
We define a StaticResource in ExampleA and reference this later in ExampleB, however it can not resolve this resource. This behaviour works in WPF (Using Blend), but doesn't when running in Noesis.
The docs state the following:
Code: Select all
<!-- App.xaml-->
<Application x:Class="GameGUI.Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GameGUI"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Resources/ExampleA.xaml" />
<ResourceDictionary Source="/Resources/ExampleB.xaml" /> <!--References a StaticResource from ExampleA-->
<ResourceDictionary Source="Resources.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>The docs state the following:
Note that we will never reach Step 3 as we are loading our application resources at the moment, so it is not set. We believe the resource should already be resolved in Step 2. Is this intended behaviour or a bug?1. The lookup process checks for the requested key within the resource dictionary defined by the element that sets the property.
2. The lookup process then traverses the logical tree upward, to the parent element and its resource dictionary. This continues until the root element is reached.
3. Next, application resources are checked. Application resources are those resources within the resource dictionary that is defined by the Application object for your application.