Exemplo n.º 1
0
        private static void updateTrackballTransform(DependencyObject source, DependencyPropertyChangedEventArgs e)
        {
            try
            {
                //if (e.NewValue == e.OldValue)
                //    return;

                bool update = false;

                if (e.OldValue == null && e.NewValue != null)
                {
                    update = true;
                }
                else if (e.NewValue != null && e.OldValue != null)
                {
                    Matrix3D newM = (e.NewValue as Transform3D).Value;
                    Matrix3D oldM = (e.OldValue as Transform3D).Value;

                    if (!newM.Equals(oldM))
                    {
                        update = true;
                    }
                }

                if (update)
                {
                    ViewControlCamera3D control = source as ViewControlCamera3D;
                    control.UpdateTrackball();
                }
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
        private static void changeCameraType(DependencyObject source, DependencyPropertyChangedEventArgs e)
        {
            try
            {
                if (e.NewValue == e.OldValue)
                {
                    return;
                }

                ViewControlCamera3D control = source as ViewControlCamera3D;
                control.correctScale();
            }
            catch
            {
            }
        }