Ejemplo n.º 1
0
        /// <summary>
        /// Callback called when the Material property's value has changed.
        /// Assign the material to the inner model.
        /// </summary>
        /// <param name="d">Sender object</param>
        /// <param name="e">Callback arguments</param>
        internal static void MaterialPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            CompositeBar3D bar = ((CompositeBar3D)d);

            if ((bar._element0 != null) && (bar._element0.Model != null))
            {
                ((GeometryModel3D)bar._element0.Model).Material = bar.Material;
            }
        }
Ejemplo n.º 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)
        {
            CompositeBar3D element = (CompositeBar3D)d;

            element.InvalidateModel();
        }