From: BradChase2011 Date: Thu, 9 Mar 2017 18:39:27 +0000 (-0500) Subject: Fixed a redundant check that caused a massive slowdown on UWP. (#788) X-Git-Tag: submit/tizen/20170424.094440~220 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=87f0bfa2e1b89f2e8f2d53eb902ea5723dcabccf;p=platform%2Fupstream%2Fxamarin-forms.git Fixed a redundant check that caused a massive slowdown on UWP. (#788) * Fixed a redundant check that caused a massive slowdown on UWP. * Fixed formatting. * Fixed formatting. * UWP_UI_Speed_Fix Last time on tabbing, lets hope so! --- diff --git a/Xamarin.Forms.Core/VisualElement.cs b/Xamarin.Forms.Core/VisualElement.cs index 476a057..905771c 100644 --- a/Xamarin.Forms.Core/VisualElement.cs +++ b/Xamarin.Forms.Core/VisualElement.cs @@ -337,12 +337,11 @@ namespace Xamarin.Forms return true; Element parent = RealParent; - while (parent != null) + if (parent != null) { var visualElement = parent as VisualElement; if (visualElement != null && visualElement.IsInNativeLayout) return true; - parent = parent.RealParent; } return false; diff --git a/Xamarin.Forms.Platform.WP8/VisualElementTracker.cs b/Xamarin.Forms.Platform.WP8/VisualElementTracker.cs index b206af5..509ffd4 100644 --- a/Xamarin.Forms.Platform.WP8/VisualElementTracker.cs +++ b/Xamarin.Forms.Platform.WP8/VisualElementTracker.cs @@ -275,6 +275,7 @@ namespace Xamarin.Forms.Platform.WinPhone { if (Model.IsInNativeLayout) return; + var parent = (FrameworkElement)Element.Parent; parent?.InvalidateMeasure(); Element.InvalidateMeasure(); diff --git a/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs b/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs index e8684ff..a29d61a 100644 --- a/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs +++ b/Xamarin.Forms.Platform.WinRT/VisualElementTracker.cs @@ -275,6 +275,7 @@ namespace Xamarin.Forms.Platform.WinRT { if (Element.IsInNativeLayout) return; + var parent = (FrameworkElement)Container.Parent; parent?.InvalidateMeasure(); Container.InvalidateMeasure();