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)}");