Example #1
0
        public void NonContainedInheritsAttachedCallbackTest()
        {
            Element1 element1 = new Element1();
            Element2 element2 = new Element2();

            element2.SetParent(element1);

            element1.SetValue(Element2.Value2InheritsAttachedProperty, 1);

            element1.AssertInstanceChanged(Element2.Value2InheritsAttachedProperty);
            element1.AssertChanged(Element2.Value2InheritsAttachedProperty);
            element1.AssertCoerced(Element2.Value2InheritsAttachedProperty);
            element1.AssertValue(Element2.Value2InheritsAttachedProperty, 1);

            element2.AssertInstanceChanged(Element2.Value2InheritsAttachedProperty);
            element2.AssertChanged(Element2.Value2InheritsAttachedProperty);
            element2.AssertCoerced(Element2.Value2InheritsAttachedProperty);
            element2.AssertValue(Element2.Value2InheritsAttachedProperty, 1);
        }
Example #2
0
        public void ContainedCallbackTest()
        {
            Element1 element1 = new Element1();
            Element2 element2 = new Element2();

            element2.SetParent(element1);

            element1.SetValue(Element1.Value1Property, 1);

            element1.AssertInstanceChanged(Element1.Value1Property);
            element1.AssertChanged(Element1.Value1Property);
            element1.AssertCoerced(Element1.Value1Property);
            element1.AssertValue(Element1.Value1Property, 1);

            element2.AssertInstanceChanged();
            element2.AssertChanged();
            element2.AssertCoerced();
            element2.AssertValue(Element1.Value1Property, 0);
        }
Example #3
0
        public void NonContainedInheritsCallbackTest()
        {
            Element1 element1 = new Element1();
            Element2 element2 = new Element2();

            element2.SetParent(element1);

            element1.SetValue(Element2.Value2InheritsProperty, 1);

            element1.AssertInstanceChanged(Element2.Value2InheritsProperty);
            element1.AssertChanged();
            element1.AssertCoerced();
            element1.AssertValue(Element2.Value2InheritsProperty, 1);

            // WPF has a bug here, while element2 value is changed (through inheritance), none of these callbacks are called
            element2.AssertInstanceChanged(Element2.Value2InheritsProperty);
            element2.AssertChanged(Element2.Value2InheritsProperty);
            element2.AssertCoerced(Element2.Value2InheritsProperty);
            element2.AssertValue(Element2.Value2InheritsProperty, 1);
        }