Beispiel #1
0
        /// <summary>
        /// Callback called when the Model property's value has changed.
        /// Assign the Visual3DModel protected CLR property
        /// Pattern described here : http://blogs.msdn.com/wpf3d/archive/2007/09/05/subclassing-uielement3d.aspx
        /// </summary>
        /// <param name="d">Sender object</param>
        /// <param name="e">Callback arguments</param>
        private static void ModelPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            GeometryElement3D element = (GeometryElement3D)d;

            element.Visual3DModel = (Model3D)e.NewValue;
        }
Beispiel #2
0
        /// <summary>
        /// Callback to call in subclasses when a visual dependency property value has changed (i.e. by databinding).
        /// </summary>
        /// <param name="d">Sender object</param>
        /// <param name="e">Callback arguments</param>
        protected static void VisualPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            GeometryElement3D element = (GeometryElement3D)d;

            element.InvalidateModel();
        }