Beispiel #1
0
        // Token: 0x06000C65 RID: 3173 RVA: 0x0002E3C0 File Offset: 0x0002C5C0
        internal static FrugalObjectList <DependencyProperty> InvalidateTreeDependentProperties(TreeChangeInfo info, FrameworkElement fe, FrameworkContentElement fce, Style selfStyle, Style selfThemeStyle, ref ChildRecord childRecord, bool isChildRecordValid, bool hasStyleChanged, bool isSelfInheritanceParent, bool wasSelfInheritanceParent)
        {
            DependencyObject dependencyObject = (fe != null) ? fe : fce;
            FrameworkObject  frameworkObject  = new FrameworkObject(fe, fce);
            FrugalObjectList <DependencyProperty> frugalObjectList = info.InheritablePropertiesStack.Peek();
            int num = (frugalObjectList != null) ? frugalObjectList.Count : 0;
            FrugalObjectList <DependencyProperty> frugalObjectList2 = null;

            if (TreeWalkHelper.HasChildren(fe, fce))
            {
                frugalObjectList2 = new FrugalObjectList <DependencyProperty>(num);
            }
            info.ResetInheritableValueIndexer();
            for (int i = 0; i < num; i++)
            {
                DependencyProperty dependencyProperty = frugalObjectList[i];
                PropertyMetadata   metadata           = dependencyProperty.GetMetadata(dependencyObject);
                if (metadata.IsInherited)
                {
                    FrameworkPropertyMetadata frameworkPropertyMetadata = (FrameworkPropertyMetadata)metadata;
                    bool flag = TreeWalkHelper.InvalidateTreeDependentProperty(info, dependencyObject, ref frameworkObject, dependencyProperty, frameworkPropertyMetadata, selfStyle, selfThemeStyle, ref childRecord, isChildRecordValid, hasStyleChanged, isSelfInheritanceParent, wasSelfInheritanceParent);
                    if (flag && frugalObjectList2 != null && (!TreeWalkHelper.SkipNow(frameworkObject.InheritanceBehavior) || frameworkPropertyMetadata.OverridesInheritanceBehavior))
                    {
                        frugalObjectList2.Add(dependencyProperty);
                    }
                }
            }
            return(frugalObjectList2);
        }
Beispiel #2
0
        // Token: 0x06000C67 RID: 3175 RVA: 0x0002E60C File Offset: 0x0002C80C
        internal static void InvalidateOnResourcesChange(FrameworkElement fe, FrameworkContentElement fce, ResourcesChangeInfo info)
        {
            FrameworkObject frameworkObject = new FrameworkObject(fe, fce);

            frameworkObject.Reset(frameworkObject.TemplatedParent);
            frameworkObject.HasTemplateChanged = false;
            DependencyObject dependencyObject = (fe != null) ? fe : fce;

            if (TreeWalkHelper.HasChildren(fe, fce))
            {
                DescendentsWalker <ResourcesChangeInfo> descendentsWalker = new DescendentsWalker <ResourcesChangeInfo>(TreeWalkPriority.LogicalTree, TreeWalkHelper.ResourcesChangeDelegate, info);
                descendentsWalker.StartWalk(dependencyObject);
                return;
            }
            TreeWalkHelper.OnResourcesChanged(dependencyObject, info, true);
        }
Beispiel #3
0
        // Token: 0x06000C6C RID: 3180 RVA: 0x0002EB1C File Offset: 0x0002CD1C
        internal static void InvalidateOnInheritablePropertyChange(FrameworkElement fe, FrameworkContentElement fce, InheritablePropertyChangeInfo info, bool skipStartNode)
        {
            DependencyProperty property        = info.Property;
            FrameworkObject    frameworkObject = new FrameworkObject(fe, fce);

            if (TreeWalkHelper.HasChildren(fe, fce))
            {
                DependencyObject @do = frameworkObject.DO;
                DescendentsWalker <InheritablePropertyChangeInfo> descendentsWalker = new DescendentsWalker <InheritablePropertyChangeInfo>(TreeWalkPriority.LogicalTree, TreeWalkHelper.InheritablePropertyChangeDelegate, info);
                descendentsWalker.StartWalk(@do, skipStartNode);
                return;
            }
            if (!skipStartNode)
            {
                bool visitedViaVisualTree = false;
                TreeWalkHelper.OnInheritablePropertyChanged(frameworkObject.DO, info, visitedViaVisualTree);
            }
        }
Beispiel #4
0
        // Token: 0x06000C61 RID: 3169 RVA: 0x0002E1F8 File Offset: 0x0002C3F8
        internal static void InvalidateOnTreeChange(FrameworkElement fe, FrameworkContentElement fce, DependencyObject parent, bool isAddOperation)
        {
            FrameworkObject frameworkObject = new FrameworkObject(parent);

            if (!frameworkObject.IsValid)
            {
                parent = frameworkObject.FrameworkParent.DO;
            }
            FrameworkObject frameworkObject2 = new FrameworkObject(fe, fce);

            if (isAddOperation)
            {
                frameworkObject2.SetShouldLookupImplicitStyles();
            }
            frameworkObject2.Reset(frameworkObject2.TemplatedParent);
            frameworkObject2.HasTemplateChanged = false;
            DependencyObject dependencyObject = (fe != null) ? fe : fce;

            if (fe != null)
            {
                if (fe.IsInitialized && !fe.HasLocalStyle)
                {
                    fe.HasStyleChanged          = false;
                    fe.HasStyleInvalidated      = false;
                    fe.HasTemplateChanged       = false;
                    fe.AncestorChangeInProgress = true;
                    fe.UpdateStyleProperty();
                    fe.AncestorChangeInProgress = false;
                }
            }
            else if (!fce.HasLocalStyle)
            {
                fce.HasStyleChanged          = false;
                fce.HasStyleInvalidated      = false;
                fce.AncestorChangeInProgress = true;
                fce.UpdateStyleProperty();
                fce.AncestorChangeInProgress = false;
            }
            if (TreeWalkHelper.HasChildren(fe, fce))
            {
                FrameworkContextData frameworkContextData = FrameworkContextData.From(dependencyObject.Dispatcher);
                if (frameworkContextData.WasNodeVisited(dependencyObject, TreeWalkHelper.TreeChangeDelegate))
                {
                    return;
                }
                TreeChangeInfo data = new TreeChangeInfo(dependencyObject, parent, isAddOperation);
                PrePostDescendentsWalker <TreeChangeInfo> prePostDescendentsWalker = new PrePostDescendentsWalker <TreeChangeInfo>(TreeWalkPriority.LogicalTree, TreeWalkHelper.TreeChangeDelegate, TreeWalkHelper.TreeChangePostDelegate, data);
                frameworkContextData.AddWalker(TreeWalkHelper.TreeChangeDelegate, prePostDescendentsWalker);
                try
                {
                    prePostDescendentsWalker.StartWalk(dependencyObject);
                    return;
                }
                finally
                {
                    frameworkContextData.RemoveWalker(TreeWalkHelper.TreeChangeDelegate, prePostDescendentsWalker);
                }
            }
            TreeChangeInfo info = new TreeChangeInfo(dependencyObject, parent, isAddOperation);

            TreeWalkHelper.OnAncestorChanged(fe, fce, info);
            bool visitedViaVisualTree = false;

            TreeWalkHelper.OnPostAncestorChanged(dependencyObject, info, visitedViaVisualTree);
        }