Exemplo n.º 1
0
        public CreateResultStars(MultiplyByTwo multiplier)
        {
            _multiplier = multiplier;

            var dpd = DependencyPropertyDescriptor.FromProperty(MultiplyByTwo.ResultProperty, typeof(MultiplyByTwo));

            dpd.AddValueChanged(_multiplier, (o, e) => RecalculateStars());

            RecalculateStars();
        }
        public void ChainedEventHandlers()
        {
            var m = new MultiplyByTwo();
            var s = new CreateResultStars(m);

            Assert.AreEqual(string.Empty, s.Stars);

            m.Number = 3;
            Assert.AreEqual("******", s.Stars);
        }