diff --git a/dev/Generated/NumberBox.properties.cpp b/dev/Generated/NumberBox.properties.cpp index 01df4ba7c8..323b3d557a 100644 --- a/dev/Generated/NumberBox.properties.cpp +++ b/dev/Generated/NumberBox.properties.cpp @@ -72,7 +72,7 @@ void NumberBoxProperties::EnsureProperties() winrt::name_of(), false /* isAttached */, ValueHelper::BoxedDefaultValue(), - nullptr); + winrt::PropertyChangedCallback(&OnHeaderPropertyChanged)); } if (!s_HeaderTemplateProperty) { @@ -275,6 +275,14 @@ void NumberBoxProperties::ClearProperties() s_ValueProperty = nullptr; } +void NumberBoxProperties::OnHeaderPropertyChanged( + winrt::DependencyObject const& sender, + winrt::DependencyPropertyChangedEventArgs const& args) +{ + auto owner = sender.as(); + winrt::get_self(owner)->OnHeaderPropertyChanged(args); +} + void NumberBoxProperties::OnIsWrapEnabledPropertyChanged( winrt::DependencyObject const& sender, winrt::DependencyPropertyChangedEventArgs const& args) diff --git a/dev/Generated/NumberBox.properties.h b/dev/Generated/NumberBox.properties.h index fb9c4757db..ed33776413 100644 --- a/dev/Generated/NumberBox.properties.h +++ b/dev/Generated/NumberBox.properties.h @@ -114,6 +114,10 @@ class NumberBoxProperties static void EnsureProperties(); static void ClearProperties(); + static void OnHeaderPropertyChanged( + winrt::DependencyObject const& sender, + winrt::DependencyPropertyChangedEventArgs const& args); + static void OnIsWrapEnabledPropertyChanged( winrt::DependencyObject const& sender, winrt::DependencyPropertyChangedEventArgs const& args); diff --git a/dev/NumberBox/InteractionTests/NumberBoxTests.cs b/dev/NumberBox/InteractionTests/NumberBoxTests.cs index c0e0e8baf4..2941c6c497 100644 --- a/dev/NumberBox/InteractionTests/NumberBoxTests.cs +++ b/dev/NumberBox/InteractionTests/NumberBoxTests.cs @@ -533,6 +533,36 @@ public void BasicExpressionTest() } } + [TestMethod] + public void VerifyNumberBoxHeaderBehavior() + { + using (var setup = new TestSetupHelper("NumberBox Tests")) + { + var toggleHeaderButton = FindElement.ByName