예제 #1
0
        public void Owned_PropertyValueChangedSender_Test()
        {
            PropertyTests temp         = null;
            var           someOwnedInt = new Property <PropertyTests, int>(this);

            someOwnedInt.ValueChanged += (sender, oldValue, newValue) =>
            {
                //the sender of PropertyValueChanged should always be the class passed in the constructor or in SetOwner
                temp = sender as PropertyTests;
            };
            someOwnedInt.Value = 5;
            Assert.IsTrue(temp == this);
        }
예제 #2
0
        public void Owned_PropertyChangedSender_Test()
        {
            PropertyTests temp         = null;
            var           someOwnedInt = new Property <PropertyTests, int>(this);

            someOwnedInt.PropertyChanged += (sender, propertyName) =>
            {
                //the sender of PropertyChanged should always be the class having the property
                temp = sender as PropertyTests;
            };
            someOwnedInt.Value = 5;
            Assert.IsTrue(temp == this);
        }