Beispiel #1
0
        /// <summary>
        /// This is a callback method that triggers OnEllipseCenterChanged method of
        /// the MyEllipse object whose EllipseCenter property got changed.
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="e"></param>
        static void MyHandler(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            MyEllipse ellipse = obj as MyEllipse;

            if (ellipse != null)
            {
                ellipse.OnEllipseCenterChanged(obj, e);
            }
        }
Beispiel #2
0
        /// <summary>
        /// This method is triggered by the callback method of EllipseCenterProperty
        /// property. It updates the Center property of the EllipseGeometry object to
        /// update UI,then it fires EllipseCenterChanged event.
        /// </summary>
        /// <param name="obj"></param>
        /// <param name="e"></param>
        void OnEllipseCenterChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            MyEllipse ellipse = obj as MyEllipse;

            if (ellipse != null)
            {
                ellipse.MyAnimatedEllipseGeometry.Center = ellipse.EllipseCenter;
            }
            if (_mydelegate != null)
            {
                _mydelegate(obj, e);
            }
        }