Esempio n. 1
0
        static void IdChangedEventManagerChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            DependencyObject Element = (DependencyObject)sender;

            // Clear local path, so that parent value is inherited for this element
            PersistentProperty.ReEvaluateIdPath(Element);
        }
Esempio n. 2
0
        private static void NotifyChildrenThatIdPathChanged(DependencyObject element)
        {
            if (element is Visual || element is Visual3D)
            {
                for (int Index = 0; Index < VisualTreeHelper.GetChildrenCount(element); Index++)
                {
                    DependencyObject Child = VisualTreeHelper.GetChild(element, Index);

                    if (Child.ReadLocalValue(PersistentProperty.IdPathProperty) != DependencyProperty.UnsetValue)
                    {
                        //there is a Context registered. this means, the context path must be re-evaluated.
                        //re-evaluation of children will be done in the called method
                        PersistentProperty.ReEvaluateIdPath(Child);
                    }
                    else
                    {
                        //no context is specified here, so check the children
                        PersistentProperty.NotifyChildrenThatIdPathChanged(Child);
                    }
                }
            }
        }