View Issue Details

IDProjectCategoryView StatusLast Update
0002101NoesisGUIC++ SDKpublic2021-09-06 13:06
Reporterfnlombard Assigned Tosfernandez  
PrioritynormalSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.1.0 
Target Version3.1.1Fixed in Version3.1.1 
Summary0002101: Merged Dictionaries not loading when calling LoadXaml
DescriptionIn our application, we have several DataTemplates that we load directly from XAML files during runtime. The typical structure of a file is shown below:

<DataTemplate
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    xmlns:sys="clr-namespace:System">

    <DataTemplate.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="MyStyleFile.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </DataTemplate.Resources>

    <StackPanel>
       <Control Style={StaticResource MyStyle}/>
    </StackPanel>
</DataTemplate>

This worked correctly in Noesis 2.2.6. In Noesis 3.1.0, it seems that the merged resource dictionary is not loaded. Consequently, the style of the control cannot be found. We use the Noesis::GUI::LoadXaml() function to load these DataTemplates. For this we do not want to use ‘SetApplicationResources’ because the style and the data template should not be globally available.
TagsResourceDictionary
PlatformWindows

Activities

fnlombard

fnlombard

2021-09-03 09:33

reporter   ~0007403

Side question:
When using 'SetApplicationResources': Merged resource dictionaries are only loaded if a XAML file's root element is a ResourceDictionary. The merged resource dictionaries of child elements, for example a ControlTemplate, are not loaded. Will the fix that you are working on also fix this?
Thanks
sfernandez

sfernandez

2021-09-03 10:34

manager   ~0007404

Yes, the bug appears in any MergedDictionary contained in templates. We will fix it for both ControlTemplates and DataTemplates.

Issue History

Date Modified Username Field Change
2021-09-01 15:29 fnlombard New Issue
2021-09-01 15:29 fnlombard Tag Attached: ResourceDictionary
2021-09-02 19:45 sfernandez Assigned To => sfernandez
2021-09-02 19:45 sfernandez Status new => assigned
2021-09-02 19:45 sfernandez Product Version 3.1 => 3.1.0
2021-09-02 19:45 sfernandez Target Version => 3.1.1
2021-09-03 09:33 fnlombard Note Added: 0007403
2021-09-03 10:34 sfernandez Status assigned => feedback
2021-09-03 10:34 sfernandez Note Added: 0007404
2021-09-06 13:06 sfernandez Status feedback => resolved
2021-09-06 13:06 sfernandez Resolution open => fixed
2021-09-06 13:06 sfernandez Fixed in Version => 3.1.1