Пример #1
0
        private static void AtDataContextChanged(FrameworkElement d, DependencyPropertyChangedEventArgs e)
        {
            var data = GetInternalData(d);

            if (data == null)
            {
                data = new BusyAdornerBehaviorData(d); SetInternalData(d, data);
            }
            var newValue = (ObjectVM)e.NewValue;

            data.DataContext = newValue;
        }
Пример #2
0
        private static void AtBindToBusyUserRequestChanged(FrameworkElement d, DependencyPropertyChangedEventArgs e)
        {
            var data = GetInternalData(d);

            if (data == null)
            {
                data = new BusyAdornerBehaviorData(d); SetInternalData(d, data);
            }
            var newValue = (bool)e.NewValue;

            data.BindToBusyUserRequest = newValue;
        }
Пример #3
0
        private static void AtIsBusyChanged(FrameworkElement d, DependencyPropertyChangedEventArgs e)
        {
            var data = GetInternalData(d);

            if (data == null)
            {
                data = new BusyAdornerBehaviorData(d); SetInternalData(d, data);
            }
            var newValue = (bool)e.NewValue;

            if (newValue)
            {
                var visual = new BusyAdornerVisual {
                    Style      = GetStyle(d),
                    Background = GetBackground(d),
                };
                data.Adorner = new BusyAdorner(d, visual);
            }
            else
            {
                data.Adorner = null;
            }
        }
Пример #4
0
 public static void SetInternalData(FrameworkElement element, BusyAdornerBehaviorData value)
 {
     element.SetValue(InternalDataProperty, value);
 }