public void TestAutoOneTimeNestedModes()
        {
            SubtreeDifferentMode userControl = new SubtreeDifferentMode();
            Button thirdButton = new Button {
                Content = "Third button"
            };

            TestAsync(
                userControl,
                () => Assert.AreEqual(Colors.Red, ((SolidColorBrush)userControl.firstButton.Background).Color),
                () => Assert.AreEqual(Colors.Red, ((SolidColorBrush)userControl.secondButton.Background).Color),
                () => userControl.secondButton.Content = thirdButton,
                () => Assert.IsNull(thirdButton.Style),
                () => ImplicitStyleManager.Apply(userControl.secondButton),
                () => Assert.AreEqual(Colors.Red, ((SolidColorBrush)userControl.firstButton.Background).Color),
                () => Assert.AreEqual(Colors.Red, ((SolidColorBrush)userControl.secondButton.Background).Color),
                () => Assert.AreEqual(Colors.Red, ((SolidColorBrush)thirdButton.Background).Color),
                () => Assert.IsNotNull(thirdButton.Style));
        }
 public void TestAutoOneTimeNestedModes()
 {
     SubtreeDifferentMode userControl = new SubtreeDifferentMode();
     Button thirdButton = new Button { Content = "Third button" };
     TestAsync(
         userControl,
         () => Assert.AreEqual(Colors.Red, ((SolidColorBrush)userControl.firstButton.Background).Color),
         () => Assert.AreEqual(Colors.Red, ((SolidColorBrush)userControl.secondButton.Background).Color),
         () => userControl.secondButton.Content = thirdButton,
         () => Assert.IsNull(thirdButton.Style),
         () => ImplicitStyleManager.Apply(userControl.secondButton),
         () => Assert.AreEqual(Colors.Red, ((SolidColorBrush)userControl.firstButton.Background).Color),
         () => Assert.AreEqual(Colors.Red, ((SolidColorBrush)userControl.secondButton.Background).Color),
         () => Assert.AreEqual(Colors.Red, ((SolidColorBrush)thirdButton.Background).Color),
         () => Assert.IsNotNull(thirdButton.Style));
 }