diff --git a/src/controls/dev/Generated/ScrollPresenter.properties.cpp b/src/controls/dev/Generated/ScrollPresenter.properties.cpp index 2cd699d9f0..36a30aafb5 100644 --- a/src/controls/dev/Generated/ScrollPresenter.properties.cpp +++ b/src/controls/dev/Generated/ScrollPresenter.properties.cpp @@ -38,11 +38,12 @@ ScrollPresenterProperties::ScrollPresenterProperties() , m_extentChangedEventSource{static_cast(this)} , m_scrollAnimationStartingEventSource{static_cast(this)} , m_scrollCompletedEventSource{static_cast(this)} + , m_scrollStartingEventSource{static_cast(this)} , m_stateChangedEventSource{static_cast(this)} , m_viewChangedEventSource{static_cast(this)} - , m_viewChangingEventSource{static_cast(this)} , m_zoomAnimationStartingEventSource{static_cast(this)} , m_zoomCompletedEventSource{static_cast(this)} + , m_zoomStartingEventSource{static_cast(this)} { EnsureProperties(); } @@ -747,6 +748,16 @@ void ScrollPresenterProperties::ScrollCompleted(winrt::event_token const& token) m_scrollCompletedEventSource.remove(token); } +winrt::event_token ScrollPresenterProperties::ScrollStarting(winrt::TypedEventHandler const& value) +{ + return m_scrollStartingEventSource.add(value); +} + +void ScrollPresenterProperties::ScrollStarting(winrt::event_token const& token) +{ + m_scrollStartingEventSource.remove(token); +} + winrt::event_token ScrollPresenterProperties::StateChanged(winrt::TypedEventHandler const& value) { return m_stateChangedEventSource.add(value); @@ -767,16 +778,6 @@ void ScrollPresenterProperties::ViewChanged(winrt::event_token const& token) m_viewChangedEventSource.remove(token); } -winrt::event_token ScrollPresenterProperties::ViewChanging(winrt::TypedEventHandler const& value) -{ - return m_viewChangingEventSource.add(value); -} - -void ScrollPresenterProperties::ViewChanging(winrt::event_token const& token) -{ - m_viewChangingEventSource.remove(token); -} - winrt::event_token ScrollPresenterProperties::ZoomAnimationStarting(winrt::TypedEventHandler const& value) { return m_zoomAnimationStartingEventSource.add(value); @@ -796,3 +797,13 @@ void ScrollPresenterProperties::ZoomCompleted(winrt::event_token const& token) { m_zoomCompletedEventSource.remove(token); } + +winrt::event_token ScrollPresenterProperties::ZoomStarting(winrt::TypedEventHandler const& value) +{ + return m_zoomStartingEventSource.add(value); +} + +void ScrollPresenterProperties::ZoomStarting(winrt::event_token const& token) +{ + m_zoomStartingEventSource.remove(token); +} diff --git a/src/controls/dev/Generated/ScrollPresenter.properties.h b/src/controls/dev/Generated/ScrollPresenter.properties.h index 9f5b265ad4..cfad166073 100644 --- a/src/controls/dev/Generated/ScrollPresenter.properties.h +++ b/src/controls/dev/Generated/ScrollPresenter.properties.h @@ -111,27 +111,30 @@ class ScrollPresenterProperties void ScrollAnimationStarting(winrt::event_token const& token); winrt::event_token ScrollCompleted(winrt::TypedEventHandler const& value); void ScrollCompleted(winrt::event_token const& token); + winrt::event_token ScrollStarting(winrt::TypedEventHandler const& value); + void ScrollStarting(winrt::event_token const& token); winrt::event_token StateChanged(winrt::TypedEventHandler const& value); void StateChanged(winrt::event_token const& token); winrt::event_token ViewChanged(winrt::TypedEventHandler const& value); void ViewChanged(winrt::event_token const& token); - winrt::event_token ViewChanging(winrt::TypedEventHandler const& value); - void ViewChanging(winrt::event_token const& token); winrt::event_token ZoomAnimationStarting(winrt::TypedEventHandler const& value); void ZoomAnimationStarting(winrt::event_token const& token); winrt::event_token ZoomCompleted(winrt::TypedEventHandler const& value); void ZoomCompleted(winrt::event_token const& token); + winrt::event_token ZoomStarting(winrt::TypedEventHandler const& value); + void ZoomStarting(winrt::event_token const& token); event_source> m_anchorRequestedEventSource; event_source> m_bringingIntoViewEventSource; event_source> m_extentChangedEventSource; event_source> m_scrollAnimationStartingEventSource; event_source> m_scrollCompletedEventSource; + event_source> m_scrollStartingEventSource; event_source> m_stateChangedEventSource; event_source> m_viewChangedEventSource; - event_source> m_viewChangingEventSource; event_source> m_zoomAnimationStartingEventSource; event_source> m_zoomCompletedEventSource; + event_source> m_zoomStartingEventSource; static void EnsureProperties(); static void ClearProperties(); diff --git a/src/controls/dev/Generated/ScrollView.properties.cpp b/src/controls/dev/Generated/ScrollView.properties.cpp index 8d3d11a9e7..61d3fa20f3 100644 --- a/src/controls/dev/Generated/ScrollView.properties.cpp +++ b/src/controls/dev/Generated/ScrollView.properties.cpp @@ -42,11 +42,12 @@ ScrollViewProperties::ScrollViewProperties() , m_extentChangedEventSource{static_cast(this)} , m_scrollAnimationStartingEventSource{static_cast(this)} , m_scrollCompletedEventSource{static_cast(this)} + , m_scrollStartingEventSource{static_cast(this)} , m_stateChangedEventSource{static_cast(this)} , m_viewChangedEventSource{static_cast(this)} - , m_viewChangingEventSource{static_cast(this)} , m_zoomAnimationStartingEventSource{static_cast(this)} , m_zoomCompletedEventSource{static_cast(this)} + , m_zoomStartingEventSource{static_cast(this)} { EnsureProperties(); } @@ -883,6 +884,16 @@ void ScrollViewProperties::ScrollCompleted(winrt::event_token const& token) m_scrollCompletedEventSource.remove(token); } +winrt::event_token ScrollViewProperties::ScrollStarting(winrt::TypedEventHandler const& value) +{ + return m_scrollStartingEventSource.add(value); +} + +void ScrollViewProperties::ScrollStarting(winrt::event_token const& token) +{ + m_scrollStartingEventSource.remove(token); +} + winrt::event_token ScrollViewProperties::StateChanged(winrt::TypedEventHandler const& value) { return m_stateChangedEventSource.add(value); @@ -903,16 +914,6 @@ void ScrollViewProperties::ViewChanged(winrt::event_token const& token) m_viewChangedEventSource.remove(token); } -winrt::event_token ScrollViewProperties::ViewChanging(winrt::TypedEventHandler const& value) -{ - return m_viewChangingEventSource.add(value); -} - -void ScrollViewProperties::ViewChanging(winrt::event_token const& token) -{ - m_viewChangingEventSource.remove(token); -} - winrt::event_token ScrollViewProperties::ZoomAnimationStarting(winrt::TypedEventHandler const& value) { return m_zoomAnimationStartingEventSource.add(value); @@ -932,3 +933,13 @@ void ScrollViewProperties::ZoomCompleted(winrt::event_token const& token) { m_zoomCompletedEventSource.remove(token); } + +winrt::event_token ScrollViewProperties::ZoomStarting(winrt::TypedEventHandler const& value) +{ + return m_zoomStartingEventSource.add(value); +} + +void ScrollViewProperties::ZoomStarting(winrt::event_token const& token) +{ + m_zoomStartingEventSource.remove(token); +} diff --git a/src/controls/dev/Generated/ScrollView.properties.h b/src/controls/dev/Generated/ScrollView.properties.h index 2c4c99c3e7..fcb82b5218 100644 --- a/src/controls/dev/Generated/ScrollView.properties.h +++ b/src/controls/dev/Generated/ScrollView.properties.h @@ -131,27 +131,30 @@ class ScrollViewProperties void ScrollAnimationStarting(winrt::event_token const& token); winrt::event_token ScrollCompleted(winrt::TypedEventHandler const& value); void ScrollCompleted(winrt::event_token const& token); + winrt::event_token ScrollStarting(winrt::TypedEventHandler const& value); + void ScrollStarting(winrt::event_token const& token); winrt::event_token StateChanged(winrt::TypedEventHandler const& value); void StateChanged(winrt::event_token const& token); winrt::event_token ViewChanged(winrt::TypedEventHandler const& value); void ViewChanged(winrt::event_token const& token); - winrt::event_token ViewChanging(winrt::TypedEventHandler const& value); - void ViewChanging(winrt::event_token const& token); winrt::event_token ZoomAnimationStarting(winrt::TypedEventHandler const& value); void ZoomAnimationStarting(winrt::event_token const& token); winrt::event_token ZoomCompleted(winrt::TypedEventHandler const& value); void ZoomCompleted(winrt::event_token const& token); + winrt::event_token ZoomStarting(winrt::TypedEventHandler const& value); + void ZoomStarting(winrt::event_token const& token); event_source> m_anchorRequestedEventSource; event_source> m_bringingIntoViewEventSource; event_source> m_extentChangedEventSource; event_source> m_scrollAnimationStartingEventSource; event_source> m_scrollCompletedEventSource; + event_source> m_scrollStartingEventSource; event_source> m_stateChangedEventSource; event_source> m_viewChangedEventSource; - event_source> m_viewChangingEventSource; event_source> m_zoomAnimationStartingEventSource; event_source> m_zoomCompletedEventSource; + event_source> m_zoomStartingEventSource; static void EnsureProperties(); static void ClearProperties(); diff --git a/src/controls/dev/NavigationView/NavigationView.cpp b/src/controls/dev/NavigationView/NavigationView.cpp index ea5f8a7a13..e2b9187650 100644 --- a/src/controls/dev/NavigationView/NavigationView.cpp +++ b/src/controls/dev/NavigationView/NavigationView.cpp @@ -2407,13 +2407,17 @@ void NavigationView::ChangeSelection(const winrt::IInspectable& prevItem, const m_pendingSelectionChangedItem = nextItem; m_pendingSelectionChangedDirection = recommendedDirection; + // Previously we used get_weak() here, but we hit a refcounting problem where + // in some scenarios the outer object gets an extra Release() in this process. + auto weakThis {winrt::make_weak(static_cast(*this))}; DispatcherQueue().TryEnqueue( winrt::DispatcherQueuePriority::Low, - winrt::DispatcherQueueHandler([weakThis{get_weak()}]() + winrt::DispatcherQueueHandler([weakThis]() { if(auto strongThis = weakThis.get()) { - strongThis->CompletePendingSelectionChange(); + NavigationView* rawThis = winrt::get_self(strongThis); + rawThis->CompletePendingSelectionChange(); } })); } diff --git a/src/controls/dev/Repeater/TestUI/RepeaterTestUIPage.xaml b/src/controls/dev/Repeater/TestUI/RepeaterTestUIPage.xaml index aa36ad9253..bbdf7507dc 100644 --- a/src/controls/dev/Repeater/TestUI/RepeaterTestUIPage.xaml +++ b/src/controls/dev/Repeater/TestUI/RepeaterTestUIPage.xaml @@ -83,6 +83,7 @@ + diff --git a/src/controls/dev/Repeater/TestUI/RepeaterTestUIPage.xaml.cs b/src/controls/dev/Repeater/TestUI/RepeaterTestUIPage.xaml.cs index 74a2257367..ddd2165d96 100644 --- a/src/controls/dev/Repeater/TestUI/RepeaterTestUIPage.xaml.cs +++ b/src/controls/dev/Repeater/TestUI/RepeaterTestUIPage.xaml.cs @@ -19,6 +19,11 @@ public RepeaterTestUIPage() { this.InitializeComponent(); + objectModelTest.Click += delegate + { + Frame.NavigateWithoutAnimation(typeof(ObjectModelTestPage)); + }; + defaultDemo.Click += delegate { Frame.NavigateWithoutAnimation(typeof(Defaults)); diff --git a/src/controls/dev/Repeater/TestUI/Repeater_TestUI.projitems b/src/controls/dev/Repeater/TestUI/Repeater_TestUI.projitems index 460919a505..894c61591d 100644 --- a/src/controls/dev/Repeater/TestUI/Repeater_TestUI.projitems +++ b/src/controls/dev/Repeater/TestUI/Repeater_TestUI.projitems @@ -37,6 +37,10 @@ MSBuild:Compile false + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -145,6 +149,9 @@ AnimationsDemoPage.xaml + + ObjectModelTestPage.xaml + BasicDemo.xaml @@ -152,14 +159,18 @@ Defaults.xaml - + + ElementsInItemsSourcePage.xaml + FlowLayoutDemoPage.xaml ItemTemplateDemo.xaml - + + ScaleAnimatedVerticalListDemo.xaml + NonVirtualStackLayoutSamplePage.xaml @@ -233,16 +244,4 @@ Images\%(Filename)%(Extension) - - - ScaleAnimatedVerticalListDemo.xaml - - - ElementsInItemsSourcePage.xaml - - - - - - \ No newline at end of file diff --git a/src/controls/dev/Repeater/TestUI/Samples/ObjectModelTestPage.xaml b/src/controls/dev/Repeater/TestUI/Samples/ObjectModelTestPage.xaml new file mode 100644 index 0000000000..fe8f44f7be --- /dev/null +++ b/src/controls/dev/Repeater/TestUI/Samples/ObjectModelTestPage.xaml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + null + TextBlock + + + + + null + ObservableCollection<string> + + + + + null + StackLayout + UniformGridLayout + + + + +