Beispiel #1
0
        public void GetMetadata_Returns_Overridden_Value()
        {
            var metadata   = new PropertyMetadata();
            var overridden = new PropertyMetadata();
            var target     = new TestProperty <string>("test", typeof(Class1), metadata);

            target.OverrideMetadata <Class2>(overridden);

            Assert.Same(overridden, target.GetMetadata <Class2>());
        }
Beispiel #2
0
        public void OverrideMetadata_Should_Merge_Values()
        {
            var metadata   = new PropertyMetadata(BindingMode.TwoWay);
            var notify     = (Action <IAvaloniaObject, bool>)((a, b) => { });
            var overridden = new PropertyMetadata();
            var target     = new TestProperty <string>("test", typeof(Class1), metadata);

            target.OverrideMetadata <Class2>(overridden);

            var result = target.GetMetadata <Class2>();

            Assert.Equal(BindingMode.TwoWay, result.DefaultBindingMode);
        }
 static DepObj2()
 {
     TestProperty.OverrideMetadata(typeof(DepObj2),
                                   new HandleChangesPropertyMetadata(10));
 }