// Also called by FrameworkContentElement internal static void SynchronizeForceInheritProperties( UIElement uiElement, ContentElement contentElement, UIElement3D uiElement3D, DependencyObject parent) { if(uiElement != null || uiElement3D != null) { bool parentValue = (bool) parent.GetValue(IsEnabledProperty); if(!parentValue) { // For Read/Write force-inherited properties, use the standard coersion pattern. // // The IsEnabled property must be coerced false if the parent is false. if (uiElement != null) { uiElement.CoerceValue(IsEnabledProperty); } else { uiElement3D.CoerceValue(IsEnabledProperty); } } parentValue = (bool) parent.GetValue(IsHitTestVisibleProperty); if(!parentValue) { // For Read/Write force-inherited properties, use the standard coersion pattern. // // The IsHitTestVisible property must be coerced false if the parent is false. if (uiElement != null) { uiElement.CoerceValue(IsHitTestVisibleProperty); } else { uiElement3D.CoerceValue(IsHitTestVisibleProperty); } } parentValue = (bool) parent.GetValue(IsVisibleProperty); if(parentValue) { // For Read-Only force-inherited properties, use a private update method. // // The IsVisible property can only be true if the parent is true. if (uiElement != null) { uiElement.UpdateIsVisibleCache(); } else { uiElement3D.UpdateIsVisibleCache(); } } } else if(contentElement != null) { bool parentValue = (bool) parent.GetValue(IsEnabledProperty); if(!parentValue) { // The IsEnabled property must be coerced false if the parent is false. contentElement.CoerceValue(IsEnabledProperty); } } }