Exemplo n.º 1
0
        /// <summary>
        /// Check end opacity and redraw control with new parameters.
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="args"></param>
        private static void EndOpacityChangedCallback(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            LoadingIndicator ctl = (LoadingIndicator)obj;

            ctl.EndOpacity = LoadingIndicator.CorrectOpacityValue((double)args.NewValue);

            ctl.CreateAnimation();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Stop animation when control becomes collapsed and create it anew - when visible.
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="args"></param>
        private static void ControlVisibilityCallback(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            LoadingIndicator ctl = (LoadingIndicator)obj;

            Visibility visibility = (Visibility)args.NewValue;

            if (ctl.GridRoot != null)
            {
                if (visibility == Visibility.Collapsed)
                {
                    ctl.GridRoot.Children.Clear();
                }
                else
                {
                    ctl.CreateAnimation();
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Redraw control with new parameters.
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="args"></param>
        private static void ValueChangedCallback(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            LoadingIndicator ctl = (LoadingIndicator)obj;

            ctl.CreateAnimation();
        }