/// <summary> /// Freezable collections need to notify their contained Freezables /// about the change in the InheritanceContext /// </summary> internal override void OnInheritanceContextChangedCore(EventArgs args) { base.OnInheritanceContextChangedCore(args); for (int i = 0; i < this.Count; i++) { DependencyObject inheritanceChild = _collection[i]; if (inheritanceChild != null && inheritanceChild.InheritanceContext == this) { inheritanceChild.OnInheritanceContextChanged(args); } } }
// Token: 0x060003F2 RID: 1010 RVA: 0x0000B410 File Offset: 0x00009610 internal override void OnInheritanceContextChangedCore(EventArgs args) { base.OnInheritanceContextChangedCore(args); if (this._actions == null) { return; } for (int i = 0; i < this._actions.Count; i++) { DependencyObject dependencyObject = this._actions[i]; if (dependencyObject != null && dependencyObject.InheritanceContext == this) { dependencyObject.OnInheritanceContextChanged(args); } } }
/// <summary> /// If we get a new inheritance context (or it goes to null) /// we need to tell actions about it. /// </summary> internal override void OnInheritanceContextChangedCore(EventArgs args) { base.OnInheritanceContextChangedCore(args); if (_actions == null) { return; } for (int i = 0; i < _actions.Count; i++) { DependencyObject action = _actions[i] as DependencyObject; if (action != null && action.InheritanceContext == this) { action.OnInheritanceContextChanged(args); } } }
[FriendAccessAllowed] // Built into Base, also used by Framework. internal static void AddInheritanceContext(DependencyObject newInheritanceContext, DependencyObject value, ref bool hasMultipleInheritanceContexts, ref DependencyObject inheritanceContext ) { // ignore the request when the new context is the same as the old, // or when there are already multiple contexts if (newInheritanceContext != inheritanceContext && !hasMultipleInheritanceContexts) { if (inheritanceContext == null || newInheritanceContext == null) { // Pick up the new context inheritanceContext = newInheritanceContext; } else { // We are now being referenced from multiple // places, clear the context hasMultipleInheritanceContexts = true; inheritanceContext = null; } value.OnInheritanceContextChanged(EventArgs.Empty); } }
[FriendAccessAllowed] // Built into Base, also used by Framework. internal static void RemoveInheritanceContext(DependencyObject oldInheritanceContext, DependencyObject value, ref bool hasMultipleInheritanceContexts, ref DependencyObject inheritanceContext ) { // ignore the request when the given context doesn't match the old one, // or when there are already multiple contexts if (oldInheritanceContext == inheritanceContext && !hasMultipleInheritanceContexts) { // clear the context inheritanceContext = null; value.OnInheritanceContextChanged(EventArgs.Empty); } }