private static void UnregisterTarget(VisibilityBridge bridge) { if (targets.Contains(bridge)) { targets.Add(bridge); } }
private void VisibilityBridge_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { if (Role == VisibilityBridgeRole.Source) { if (IsVisible) { VisibilityBridge target = GetTarget(CommonParent); if (target != null) { target.IsSourceVisible = true; } } else { VisibilityBridge target = GetTarget(CommonParent); if (target != null) { target.IsSourceVisible = false; } } } }
private static VisibilityBridge GetTarget(FrameworkElement commonParent) { VisibilityBridge target = targets.FirstOrDefault(vb => vb.CommonParent == commonParent); return(target); }