Exemplo n.º 1
0
        // evaluate the current state of the trigger
        internal override bool GetCurrentState(DependencyObject container, UncommonField<HybridDictionary[]> dataField)
        {
            Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
                "This method assumes there is exactly one TriggerCondition." );

            return TriggerConditions[0].ConvertAndMatch(StyleHelper.GetDataTriggerValue(dataField, container, TriggerConditions[0].Binding));
        }
Exemplo n.º 2
0
        // evaluate the current state of the trigger
        internal virtual bool GetCurrentState(DependencyObject container, UncommonField <HybridDictionary[]> dataField)
        {
            Debug.Assert(false,
                         "This method was written to handle Trigger, MultiTrigger, DataTrigger, and MultiDataTrigger.  It looks like a new trigger type was added - please add support as appropriate.");

            return(false);
        }
Exemplo n.º 3
0
        // evaluate the current state of the trigger
        internal override bool GetCurrentState(DependencyObject container, UncommonField <HybridDictionary[]> dataField)
        {
            Debug.Assert(TriggerConditions != null && TriggerConditions.Length == 1,
                         "This method assumes there is exactly one TriggerCondition.");

            Debug.Assert(TriggerConditions[0].SourceChildIndex == 0,
                         "This method was created to handle properties on the containing object, more work is needed to handle templated children too.");

            return(TriggerConditions[0].Match(container.GetValue(TriggerConditions[0].Property)));
        }
Exemplo n.º 4
0
        // evaluate the current state of the trigger
        internal override bool GetCurrentState(DependencyObject container, UncommonField <HybridDictionary[]> dataField)
        {
            bool retVal = (TriggerConditions.Length > 0);

            for (int i = 0; retVal && i < TriggerConditions.Length; i++)
            {
                retVal = TriggerConditions[i].ConvertAndMatch(StyleHelper.GetDataTriggerValue(dataField, container, TriggerConditions[i].Binding));
            }

            return(retVal);
        }
        // Token: 0x06000791 RID: 1937 RVA: 0x000179A4 File Offset: 0x00015BA4
        internal override bool GetCurrentState(DependencyObject container, UncommonField <HybridDictionary[]> dataField)
        {
            bool flag = base.TriggerConditions.Length != 0;
            int  num  = 0;

            while (flag && num < base.TriggerConditions.Length)
            {
                flag = base.TriggerConditions[num].ConvertAndMatch(StyleHelper.GetDataTriggerValue(dataField, container, base.TriggerConditions[num].Binding));
                num++;
            }
            return(flag);
        }
        // Token: 0x06000798 RID: 1944 RVA: 0x00017B60 File Offset: 0x00015D60
        internal override bool GetCurrentState(DependencyObject container, UncommonField <HybridDictionary[]> dataField)
        {
            bool flag = base.TriggerConditions.Length != 0;
            int  num  = 0;

            while (flag && num < base.TriggerConditions.Length)
            {
                flag = base.TriggerConditions[num].Match(container.GetValue(base.TriggerConditions[num].Property));
                num++;
            }
            return(flag);
        }
Exemplo n.º 7
0
        // evaluate the current state of the trigger
        internal override bool GetCurrentState(DependencyObject container, UncommonField <HybridDictionary[]> dataField)
        {
            bool retVal = (TriggerConditions.Length > 0);

            for (int i = 0; retVal && i < TriggerConditions.Length; i++)
            {
                Debug.Assert(TriggerConditions[i].SourceChildIndex == 0,
                             "This method was created to handle properties on the containing object, more work is needed to handle templated children too.");

                retVal = TriggerConditions[i].Match(container.GetValue(TriggerConditions[i].Property));
            }

            return(retVal);
        }
Exemplo n.º 8
0
 // Token: 0x06000C82 RID: 3202 RVA: 0x0002F146 File Offset: 0x0002D346
 internal override bool GetCurrentState(DependencyObject container, UncommonField <HybridDictionary[]> dataField)
 {
     return(base.TriggerConditions[0].Match(container.GetValue(base.TriggerConditions[0].Property)));
 }
Exemplo n.º 9
0
 // Token: 0x06000399 RID: 921 RVA: 0x0000A539 File Offset: 0x00008739
 internal override bool GetCurrentState(DependencyObject container, UncommonField <HybridDictionary[]> dataField)
 {
     return(base.TriggerConditions[0].ConvertAndMatch(StyleHelper.GetDataTriggerValue(dataField, container, base.TriggerConditions[0].Binding)));
 }
        // Token: 0x06000691 RID: 1681 RVA: 0x00014908 File Offset: 0x00012B08
        internal DependencyObject InstantiateTree(UncommonField <HybridDictionary[]> dataField, DependencyObject container, DependencyObject parent, List <DependencyObject> affectedChildren, ref List <DependencyObject> noChildIndexChildren, ref FrugalStructList <ChildPropertyDependent> resourceDependents)
        {
            EventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordXamlBaml, EventTrace.Level.Verbose, EventTrace.Event.WClientParseFefCrInstBegin);
            FrameworkElement frameworkElement = container as FrameworkElement;
            bool             flag             = frameworkElement != null;
            DependencyObject dependencyObject = null;

            if (this._text != null)
            {
                IAddChild addChild = parent as IAddChild;
                if (addChild == null)
                {
                    throw new InvalidOperationException(SR.Get("TypeMustImplementIAddChild", new object[]
                    {
                        parent.GetType().Name
                    }));
                }
                addChild.AddText(this._text);
            }
            else
            {
                dependencyObject = this.CreateDependencyObject();
                EventTrace.EasyTraceEvent(EventTrace.Keyword.KeywordXamlBaml, EventTrace.Level.Verbose, EventTrace.Event.WClientParseFefCrInstEnd);
                FrameworkObject frameworkObject = new FrameworkObject(dependencyObject);
                Visual3D        visual3D        = null;
                bool            flag2           = false;
                if (!frameworkObject.IsValid)
                {
                    visual3D = (dependencyObject as Visual3D);
                    if (visual3D != null)
                    {
                        flag2 = true;
                    }
                }
                bool isFE = frameworkObject.IsFE;
                if (!flag2)
                {
                    FrameworkElementFactory.NewNodeBeginInit(isFE, frameworkObject.FE, frameworkObject.FCE);
                    if (StyleHelper.HasResourceDependentsForChild(this._childIndex, ref resourceDependents))
                    {
                        frameworkObject.HasResourceReference = true;
                    }
                    FrameworkElementFactory.UpdateChildChains(this._childName, this._childIndex, isFE, frameworkObject.FE, frameworkObject.FCE, affectedChildren, ref noChildIndexChildren);
                    FrameworkElementFactory.NewNodeStyledParentProperty(container, flag, isFE, frameworkObject.FE, frameworkObject.FCE);
                    if (this._childIndex != -1)
                    {
                        StyleHelper.CreateInstanceDataForChild(dataField, container, dependencyObject, this._childIndex, this._frameworkTemplate.HasInstanceValues, ref this._frameworkTemplate.ChildRecordFromChildIndex);
                    }
                    if (this.HasLoadedChangeHandler)
                    {
                        BroadcastEventHelper.AddHasLoadedChangeHandlerFlagInAncestry(dependencyObject);
                    }
                }
                else if (this._childName != null)
                {
                    affectedChildren.Add(dependencyObject);
                }
                else
                {
                    if (noChildIndexChildren == null)
                    {
                        noChildIndexChildren = new List <DependencyObject>(4);
                    }
                    noChildIndexChildren.Add(dependencyObject);
                }
                if (container == parent)
                {
                    TemplateNameScope value = new TemplateNameScope(container);
                    NameScope.SetNameScope(dependencyObject, value);
                    if (flag)
                    {
                        frameworkElement.TemplateChild = frameworkObject.FE;
                    }
                    else
                    {
                        FrameworkElementFactory.AddNodeToLogicalTree((FrameworkContentElement)parent, this._type, isFE, frameworkObject.FE, frameworkObject.FCE);
                    }
                }
                else
                {
                    this.AddNodeToParent(parent, frameworkObject);
                }
                if (!flag2)
                {
                    StyleHelper.InvalidatePropertiesOnTemplateNode(container, frameworkObject, this._childIndex, ref this._frameworkTemplate.ChildRecordFromChildIndex, false, this);
                }
                else
                {
                    for (int i = 0; i < this.PropertyValues.Count; i++)
                    {
                        if (this.PropertyValues[i].ValueType != PropertyValueType.Set)
                        {
                            throw new NotSupportedException(SR.Get("Template3DValueOnly", new object[]
                            {
                                this.PropertyValues[i].Property
                            }));
                        }
                        object    obj       = this.PropertyValues[i].ValueInternal;
                        Freezable freezable = obj as Freezable;
                        if (freezable != null && !freezable.CanFreeze)
                        {
                            obj = freezable.Clone();
                        }
                        MarkupExtension markupExtension = obj as MarkupExtension;
                        if (markupExtension != null)
                        {
                            ProvideValueServiceProvider provideValueServiceProvider = new ProvideValueServiceProvider();
                            provideValueServiceProvider.SetData(visual3D, this.PropertyValues[i].Property);
                            obj = markupExtension.ProvideValue(provideValueServiceProvider);
                        }
                        visual3D.SetValue(this.PropertyValues[i].Property, obj);
                    }
                }
                for (FrameworkElementFactory frameworkElementFactory = this._firstChild; frameworkElementFactory != null; frameworkElementFactory = frameworkElementFactory._nextSibling)
                {
                    frameworkElementFactory.InstantiateTree(dataField, container, dependencyObject, affectedChildren, ref noChildIndexChildren, ref resourceDependents);
                }
                if (!flag2)
                {
                    FrameworkElementFactory.NewNodeEndInit(isFE, frameworkObject.FE, frameworkObject.FCE);
                }
            }
            return(dependencyObject);
        }
Exemplo n.º 11
0
 // Token: 0x06000CC4 RID: 3268 RVA: 0x0000B02A File Offset: 0x0000922A
 internal virtual bool GetCurrentState(DependencyObject container, UncommonField <HybridDictionary[]> dataField)
 {
     return(false);
 }