예제 #1
0
        private NotifyPropertyChangedImpl GetFirstOrderObject()
        {
            var firstOrder = new NotifyPropertyChangedImpl(0);

            firstOrder.Child = new NotifyPropertyChangedImpl(1);

            return(firstOrder);
        }
예제 #2
0
        private NotifyPropertyChangedImpl GetSecondOrderObject()
        {
            var secondOrder = new NotifyPropertyChangedImpl(0);

            secondOrder.Child       = new NotifyPropertyChangedImpl(1);
            secondOrder.Child.Child = new NotifyPropertyChangedImpl(2);

            return(secondOrder);
        }
예제 #3
0
        private NotifyPropertyChangedImpl GetThirdOrderObject()
        {
            var thirdOrder = new NotifyPropertyChangedImpl(0);

            thirdOrder.Child             = new NotifyPropertyChangedImpl(1);
            thirdOrder.Child.Child       = new NotifyPropertyChangedImpl(2);
            thirdOrder.Child.Child.Child = new NotifyPropertyChangedImpl(3);

            return(thirdOrder);
        }
예제 #4
0
        public void SetProperty_GivenSimplePropertyFilter_WhenFirstOrdeSet_RaisesTriggeredEvent()
        {
            var firstOrder = new NotifyPropertyChangedImpl(0);

            var  p           = new PropertyChangedTrigger(firstOrder, "Child", null, _logger);
            bool triggered   = false;
            int  triggeredBy = -1;

            p.Triggered += (sender, args) => {
                triggeredBy = ((args.GetTripOrigin().Signal as BoundPropertyChangedEventArgs).PropertyOwner as NotifyPropertyChangedImpl).NestLevel;
                triggered   = true;
            };

            p.Activate(null);
            firstOrder.Child = new NotifyPropertyChangedImpl(1);

            Assert.IsTrue(triggered);
            Assert.AreEqual(0, triggeredBy);
        }