Exemplo n.º 1
0
        public void RemoveNotifyPropertyChanged()
        {
            var obj = new NotifyPropertyChangedEventObject {
                StringValue = "Hello",
            };
            var left = "";

            var b = Binding.Create(() => left == obj.StringValue);

            Assert.AreEqual(1, obj.PropertyChangedCount);

            Assert.AreEqual(obj.StringValue, left);

            obj.StringValue = "Goodbye";

            Assert.AreEqual("Goodbye", left);

            b.Unbind();

            Assert.AreEqual(0, obj.PropertyChangedCount);

            obj.StringValue = "Hello Again";

            Assert.AreEqual("Goodbye", left);
        }
Exemplo n.º 2
0
        public void NotifyPropertyChanged()
        {
            var obj = new NotifyPropertyChangedEventObject {
                StringValue = "Hello",
            };
            var left = "";

            Binding.Create (() => left == obj.StringValue);

            Assert.AreEqual (1, obj.PropertyChangedCount);

            Assert.AreEqual (obj.StringValue, left);

            obj.StringValue = "Goodbye";

            Assert.AreEqual ("Goodbye", left);
        }