Пример #1
0
        private static void BindableWidthCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            ProgressRing progressRing = dependencyObject as ProgressRing;

            if (progressRing == null)
            {
                return;
            }
            Action action = () => {
                progressRing.SetEllipseDiameter((double)dependencyPropertyChangedEventArgs.NewValue);
                progressRing.SetEllipseOffset((double)dependencyPropertyChangedEventArgs.NewValue);
                progressRing.SetMaxSideLength((double)dependencyPropertyChangedEventArgs.NewValue);
            };

            if (progressRing._deferredActions == null)
            {
                action();
                return;
            }
            progressRing._deferredActions.Add(action);
        }