示例#1
0
 private void DetachVisibilityHandler(WindowCommandsItem container)
 {
     if (container != null)
     {
         container.VisibilityPropertyChangeNotifier = null;
     }
 }
示例#2
0
        private void AttachVisibilityHandler(WindowCommandsItem container, UIElement item)
        {
            if (container != null)
            {
                // hide the container, if there is no UIElement
                if (null == item)
                {
                    container.Visibility = Visibility.Collapsed;
                    return;
                }

                container.Visibility = item.Visibility;
                var isVisibilityNotifier = new PropertyChangeNotifier(item, UIElement.VisibilityProperty);
                isVisibilityNotifier.ValueChanged += VisibilityPropertyChanged;
                container.VisibilityPropertyChangeNotifier = isVisibilityNotifier;
            }
        }