Пример #1
0
        private static void OnHiddenUiElementChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            var uiElement = (UIElement)sender;

            if (e.OldValue != null)
            {
                GetVisibilityTimer((UIElement)e.OldValue).Dispose();
            }

            if (e.NewValue == null)
            {
                uiElement.MouseLeftButtonDown -= MouseDownEvent;
                SetVisibilityTimer(uiElement, null);
            }
            else if (e.OldValue == null)
            {
                var hiddenUiElement = (UIElement)e.NewValue;
                hiddenUiElement.Visibility     = Visibility.Collapsed;
                uiElement.MouseLeftButtonDown += MouseDownEvent;
                var visibilityTimer = new PanelControlTimer(hiddenUiElement);
                SetVisibilityTimer(uiElement, visibilityTimer);
            }
        }
Пример #2
0
 private static void SetVisibilityTimer(UIElement uiElement, PanelControlTimer value)
 {
     uiElement.SetValue(VisibilityTimerProperty, value);
 }