src/Runtime/Runtime/System.Windows/ResourceDictionary.cs
/// <summary>
/// This sends down the owners of this ResourceDictionary into the given
/// merged dictionary.  We do this because whenever a merged dictionary
/// changes it should invalidate all owners of its parent ResourceDictionary.
///
/// Note that AddOwners throw if the merged dictionary already has one of the
/// parent's owners.  This implies that either we're putting a dictionary
/// into its own MergedDictionaries collection or we're putting the same
/// dictionary into the collection twice, neither of which are legal.
/// </summary>
/// <param name="mergedDictionary"></param>
This sends down the owners of this ResourceDictionary into the given
merged dictionary.  We do this because whenever a merged dictionary
changes it should invalidate all owners of its parent ResourceDictionary.

Note that AddOwners throw if the merged dictionary already has one of the
parent's owners.  This implies that either we're putting a dictionary
into its own MergedDictionaries collection or we're putting the same
dictionary into the collection twice, neither of which are legal.
This sends down the owners of this ResourceDictionary into the given merged dictionary . We do this because whenever a merged dictionary changes it should invalidate all owners of its parent ResourceDictionary . Note that AddOwners throw if the merged dictionary already has one of the parent ' s owners . This implies that either we ' re putting a dictionary into its own MergedDictionaries collection or we ' re putting the same dictionary into the collection twice neither of which are legal .
private void PropagateParentOwners(ResourceDictionary mergedDictionary)
        {
            if (this._ownerFEs != null)
            {
                Debug.Assert(this._ownerFEs.Count > 0);
                if (mergedDictionary._ownerFEs == null)
                {
#if BRIDGE
                    mergedDictionary._ownerFEs = new List<FrameworkElement>(this._ownerFEs.Count);
#else
                    mergedDictionary._ownerFEs = new WeakReferenceList(this._ownerFEs.Count);
#endif
                }
                foreach (FrameworkElement fe in this._ownerFEs)
                {
                    if (fe != null)
                    {
                        mergedDictionary.AddOwner(fe);
                    }
                }
            }
            if (this._ownerApps != null)
            {
                Debug.Assert(this._ownerApps.Count > 0);
                if (mergedDictionary._ownerApps == null)
                {
#if BRIDGE
                    mergedDictionary._ownerApps = new List<Application>(this._ownerApps.Count);
#else
                    mergedDictionary._ownerApps = new WeakReferenceList(this._ownerApps.Count);
#endif
                }
                foreach (Application app in _ownerApps)
                {
                    if (app != null)
                    {
                        mergedDictionary.AddOwner(app);
                    }
                }
            }
        }
private void PropagateParentOwners ( ResourceDictionary mergedDictionary ) { if ( this . _ownerFEs != null ) { Debug . Assert ( this . _ownerFEs . Count > 0 ) ; if ( mergedDictionary . _ownerFEs == null ) { if BRIDGE mergedDictionary . _ownerFEs = new List < FrameworkElement > ( this . _ownerFEs . Count ) ; else mergedDictionary . _ownerFEs = new WeakReferenceList ( this . _ownerFEs . Count ) ; endif } foreach ( FrameworkElement fe in this . _ownerFEs ) { if ( fe != null ) { mergedDictionary . AddOwner ( fe ) ; } } } if ( this . _ownerApps != null ) { Debug . Assert ( this . _ownerApps . Count > 0 ) ; if ( mergedDictionary . _ownerApps == null ) { if BRIDGE mergedDictionary . _ownerApps = new List < Application > ( this . _ownerApps . Count ) ; else mergedDictionary . _ownerApps = new WeakReferenceList ( this . _ownerApps . Count ) ; endif } foreach ( Application app in _ownerApps ) { if ( app != null ) { mergedDictionary . AddOwner ( app ) ; } } } }
This sends down the owners of this ResourceDictionary into the given
merged dictionary.
This sends down the owners of this ResourceDictionary into the given merged dictionary .
mergedDictionary
ResourceDictionary
None