From ce59cfbdf20a3044cb7e94f20a878ab56ab4ae7d Mon Sep 17 00:00:00 2001 From: vatsashah45 Date: Tue, 15 Oct 2024 16:35:11 -0400 Subject: [PATCH] chore: resolving comments --- .../ZoomContentControl/ZoomContentControl.Properties.cs | 2 +- .../Controls/ZoomContentControl/ZoomContentControl.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.Properties.cs b/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.Properties.cs index 96c0b215d..1572a0e3f 100644 --- a/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.Properties.cs +++ b/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.Properties.cs @@ -462,7 +462,7 @@ public Thickness AdditionalMargin public BoundsVisibilityFlag ContentBoundsVisibility { get => (BoundsVisibilityFlag)GetValue(ContentBoundsVisibilityProperty); - set => SetValue(ContentBoundsVisibilityProperty, value); + private set => SetValue(ContentBoundsVisibilityProperty, value); } #endregion diff --git a/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.cs b/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.cs index a74da89c9..58a3a4c5b 100644 --- a/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.cs +++ b/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.cs @@ -77,8 +77,6 @@ public ZoomContentControl() public event EventHandler? RenderedContentUpdated; // Properties - private bool ResetZoomAndOffsetWhenInactive { get; set; } = true; - public Size AvailableSize { get @@ -170,7 +168,7 @@ private async void UpdateHorizontalScrollBarValue() private void IsActiveChanged() { - if (ResetZoomAndOffsetWhenInactive && !IsActive) + if (!IsActive) { RemoveOffset(); ResetZoom(); @@ -208,6 +206,8 @@ private void CoerceZoomLevel() // Template handling protected override void OnApplyTemplate() { + base.OnApplyTemplate(); + T FindTemplatePart(string name) where T : class => (GetTemplateChild(name) ?? throw new Exception($"Expected template part not found: {name}")) as T ?? throw new Exception($"Expected template part '{name}' to be of type: {typeof(T)}");