From da8b658b4a401ed11103b115fc70a82427184fb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Brid?= <36547063+RBrid@users.noreply.github.com> Date: Sat, 19 Feb 2022 18:01:01 -0800 Subject: [PATCH] Avoid layout cycle changing SelectedBackgroundPath Path size within TabViewItem::OnSizeChanged synchronously (#6747) --- dev/TabView/TabViewItem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/TabView/TabViewItem.cpp b/dev/TabView/TabViewItem.cpp index f308225378..c99ef5981c 100644 --- a/dev/TabView/TabViewItem.cpp +++ b/dev/TabView/TabViewItem.cpp @@ -138,7 +138,10 @@ void TabViewItem::OnLoaded(const winrt::IInspectable& sender, const winrt::Route void TabViewItem::OnSizeChanged(const winrt::IInspectable&, const winrt::SizeChangedEventArgs& args) { - UpdateTabGeometry(); + m_dispatcherHelper.RunAsync([strongThis = get_strong()]() + { + strongThis->UpdateTabGeometry(); + }); } void TabViewItem::OnIsSelectedPropertyChanged(const winrt::DependencyObject& sender, const winrt::DependencyProperty& args)