Home Dashboard Directory Help
Search

Merge dictionaries does not work when we merge merged dictionaries by DrWeb86


Status: 

Closed


8
0
Sign in
to vote
Type: Suggestion
ID: 609601
Opened: 10/2/2010 8:33:49 AM
Access Restriction: Public
1
Workaround(s)
view

Description

Suppose we have merge dictionary GridRes where we override several templates for grid

Suppose we have resource dictionary AllResources where we merged GridRes

Suppose we have a form with a grid where we programmatically or via xaml loaded AllResources as merged dictionary.

Override templates were not overrided with redefined for grid (but when we copy them from gridRes to Resources of window all goes fine)

So mergeddictionary's merged dictionaries are not handled well.
Details
Sign in to post a comment.
Posted by Microsoft on 11/15/2012 at 3:29 PM
The WPF team has recently reviewed this issue and will not be addressing this issue as at this time the team is focusing on the bugs impacting the highest number of WPF developers. If you believe that this was resolved in error, please reactivate this bug with any necessary supporting details.

We appreciate the feedback. However, this issue will not be addressed in the next version of WPF. Thank you.
–WPF Team.
Posted by arnie on 5/11/2011 at 3:15 PM
We see the same thing.

When we nest merge dictionaries together of 3 levels or deeper things don't work. The suggested workaround to create a "dummy" default style at the root or anywhere else also doesn't fix anything. Seems like a bug to me.Please fix.
Posted by Microsoft on 10/3/2010 at 6:21 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by DrWeb86 on 10/2/2010 at 8:37 AM
window.ctor
{
Merge(Resources, MyDictionaryWithMergedDicsInside);
InitializeComponent();
}

public static void Merge(ResourceDictionary formDict, ResourceDictionary src)
        {
            foreach (var key in src.Keys)
            {
                if (formDict.Contains(key))
                {
                    formDict[key] = src[key];
                }
                else
                {
                    formDict.Add(key, src[key]);
                }
            }

            foreach (var mergedDic in src.MergedDictionaries)
            {
                MergeDictionary(formDict, mergedDic);
            }
        }