예제 #1
0
        public void TwoWay_Binding_Should_Not_Call_Setter_On_Creation()
        {
            var target = new Class1();
            var source = new TestTwoWayBindingViewModel();

            target.Bind(Class1.DoubleValueProperty, new Binding(nameof(source.Value), BindingMode.TwoWay)
            {
                Source = source
            });

            Assert.False(source.SetterCalled);
        }
예제 #2
0
        public void TwoWay_Binding_Should_Not_Call_Setter_On_Creation_Indexer_With_Value()
        {
            var target = new Class1();
            var source = new TestTwoWayBindingViewModel()
            {
                [0] = 1
            };

            source.ResetSetterCalled();

            target.Bind(Class1.DoubleValueProperty, new Binding("[0]", BindingMode.TwoWay)
            {
                Source = source
            });

            Assert.False(source.SetterCalled);
        }