Esempio n. 1
0
        private static void OnMaskLayerOpacityPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Project1UIModal obj = d as Project1UIModal;

            if (obj != null)
            {
                double value = (double)e.NewValue;
                if (value == 0)
                {
                    obj.Visibility = Visibility.Hidden;
                }
                if (value > 0 && obj.Visibility == Visibility.Hidden)
                {
                    obj.Visibility = Visibility.Visible;
                }
            }
        }
Esempio n. 2
0
        private static void OnShowPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Project1UIModal obj = d as Project1UIModal;

            if (obj != null)
            {
                bool value = (bool)e.NewValue;
                if (value)
                {
                    if (obj.Visibility == Visibility.Hidden)
                    {
                        obj.Visibility = Visibility.Visible;
                    }
                    obj.closeTimer.Interval = new TimeSpan(0, 0, obj.Duration);
                    if (!obj.closeTimer.IsEnabled && obj.Duration > 0)
                    {
                        obj.closeTimer.Start();
                    }
                }
            }
        }