diff --git a/doc/controls/ZoomContentControl.md b/doc/controls/ZoomContentControl.md index b7eec9a20..c501da467 100644 --- a/doc/controls/ZoomContentControl.md +++ b/doc/controls/ZoomContentControl.md @@ -49,24 +49,19 @@ xmlns:utu="using:Uno.Toolkit.UI" | Property| Type | Description | |-|-|-| -| `ZoomLevel` | `double` | Gets or sets the current zoom level for the content. | -| `MinZoomLevel` | `double` | Gets or sets the minimum zoom level allowed for the content. | -| `MaxZoomLevel` | `double` | Gets or sets the maximum zoom level allowed for the content. | | `IsZoomAllowed` | `bool` | Gets or sets a value indicating whether zooming is allowed. | -| `IsPanAllowed` | `bool` | Gets or sets a value indicating whether panning is allowed. | -| `HorizontalOffest` | `double` | Gets or sets the horizontal offset for panning. | -| `VerticalOffset` | `double` | Gets or sets the vertical offset for panning. | -| `HorizontalZoomCenter` | `double` | Gets or sets the horizontal center point of the zooming operation. | -| `VerticalZoomCenter` | `double` | Gets or sets the vertical center point of the zooming operation. | | `ScaleWheelRatio` | `double` | Gets or sets the ratio for scaling zoom level when using a mouse wheel. | | `PanWheelRatio` | `double` | Gets or sets the ratio for panning when using a mouse wheel. | -| `ResetWhenNotActive` | `bool` | Gets or sets a value indicating whether the zoom and pan should reset when the control is not active. | -| `AutoZoomToCanvasOnSizeChanged` | `bool` | Gets or sets a value indicating whether the control should automatically adjust zoom when resized. | +| `IsPanAllowed` | `bool` | Gets or sets a value indicating whether panning is allowed. | +| `ViewportWidth` | `bool` | Gets or sets the width of the content's viewport. | +| `ViewportHeight` | `bool` | Gets or sets the height of the content's viewport. | | `IsActive` | `bool` | Gets or sets a value indicating whether the control is active. | +| `AutoFitToCanvas` | `bool` | Determines if the content should automatically fit into the available canvas when the control resizes. | +| `AdditionalMargin` | `Thickness` | Gets or sets additional margins around the content. | ### Methods | Method| Return Type| Description| |-----------------------|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `FitToCanvas()`| `void`| Adjust the zoom level so that the content fits within the available space.| -| `CenterContent()`| `void`| Centers the content within the available space.| +| `ResetViewport()`| `void`| Resets the zoom level and panning offset to their default values and centers the content.| diff --git a/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.Properties.cs b/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.Properties.cs index cd4be8368..88fb70b62 100644 --- a/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.Properties.cs +++ b/src/Uno.Toolkit.UI/Controls/ZoomContentControl/ZoomContentControl.Properties.cs @@ -35,83 +35,83 @@ namespace Uno.Toolkit.UI; public partial class ZoomContentControl { - #region DependencyProperty: HorizontalScrollValue + #region DependencyProperty: [Private] HorizontalScrollValue - public static DependencyProperty HorizontalScrollValueProperty { get; } = DependencyProperty.Register( + private static DependencyProperty HorizontalScrollValueProperty { get; } = DependencyProperty.Register( nameof(HorizontalScrollValue), typeof(double), typeof(ZoomContentControl), new PropertyMetadata(default(double), OnHorizontalScrollValueChanged)); - public double HorizontalScrollValue + private double HorizontalScrollValue { get => (double)GetValue(HorizontalScrollValueProperty); set => SetValue(HorizontalScrollValueProperty, value); } #endregion - #region DependencyProperty: HorizontalMinScroll + #region DependencyProperty: [Private] HorizontalMinScroll /// Identifies the HorizontalMinScroll dependency property. - public static DependencyProperty HorizontalMinScrollProperty { get; } = DependencyProperty.Register( + private static DependencyProperty HorizontalMinScrollProperty { get; } = DependencyProperty.Register( nameof(HorizontalMinScroll), typeof(double), typeof(ZoomContentControl), new PropertyMetadata(default(double))); /// Gets or sets the minimum horizontal scroll limit. - public double HorizontalMinScroll + private double HorizontalMinScroll { get => (double)GetValue(HorizontalMinScrollProperty); set => SetValue(HorizontalMinScrollProperty, value); } #endregion - #region DependencyProperty: HorizontalMaxScroll + #region DependencyProperty: [Private] HorizontalMaxScroll /// Identifies the HorizontalMaxScroll dependency property. - public static DependencyProperty HorizontalMaxScrollProperty { get; } = DependencyProperty.Register( + private static DependencyProperty HorizontalMaxScrollProperty { get; } = DependencyProperty.Register( nameof(HorizontalMaxScroll), typeof(double), typeof(ZoomContentControl), new PropertyMetadata(default(double))); /// Gets or sets the maximum horizontal scroll limit. - public double HorizontalMaxScroll + private double HorizontalMaxScroll { get => (double)GetValue(HorizontalMaxScrollProperty); set => SetValue(HorizontalMaxScrollProperty, value); } #endregion - #region DependencyProperty: HorizontalZoomCenter + #region DependencyProperty: [Private] HorizontalZoomCenter /// Identifies the HorizontalZoomCenter dependency property. - public static DependencyProperty HorizontalZoomCenterProperty { get; } = DependencyProperty.Register( + private static DependencyProperty HorizontalZoomCenterProperty { get; } = DependencyProperty.Register( nameof(HorizontalZoomCenter), typeof(double), typeof(ZoomContentControl), new PropertyMetadata(default(double))); /// Gets or sets the horizontal center point for zooming. - public double HorizontalZoomCenter + private double HorizontalZoomCenter { get => (double)GetValue(HorizontalZoomCenterProperty); set => SetValue(HorizontalZoomCenterProperty, value); } #endregion - #region DependencyProperty: IsHorizontalScrollBarVisible + #region DependencyProperty: [Private] IsHorizontalScrollBarVisible /// Identifies the IsHorizontalScrollBarVisible dependency property. - public static DependencyProperty IsHorizontalScrollBarVisibleProperty { get; } = DependencyProperty.Register( + private static DependencyProperty IsHorizontalScrollBarVisibleProperty { get; } = DependencyProperty.Register( nameof(IsHorizontalScrollBarVisible), typeof(bool), typeof(ZoomContentControl), new PropertyMetadata(true)); /// Gets or sets a value indicating whether the horizontal scrollbar is visible. - public bool IsHorizontalScrollBarVisible + private bool IsHorizontalScrollBarVisible { get => (bool)GetValue(IsHorizontalScrollBarVisibleProperty); set => SetValue(IsHorizontalScrollBarVisibleProperty, value); @@ -119,83 +119,83 @@ public bool IsHorizontalScrollBarVisible #endregion - #region DependencyProperty: VerticalScrollValue + #region DependencyProperty: [Private] VerticalScrollValue - public static DependencyProperty VerticalScrollValueProperty { get; } = DependencyProperty.Register( + private static DependencyProperty VerticalScrollValueProperty { get; } = DependencyProperty.Register( nameof(VerticalScrollValue), typeof(double), typeof(ZoomContentControl), new PropertyMetadata(default(double), OnVerticalScrollValueChanged)); - public double VerticalScrollValue + private double VerticalScrollValue { get => (double)GetValue(VerticalScrollValueProperty); set => SetValue(VerticalScrollValueProperty, value); } #endregion - #region DependencyProperty: VerticalMaxScroll + #region DependencyProperty: [Private] VerticalMaxScroll /// Identifies the VerticalMaxScroll dependency property. - public static DependencyProperty VerticalMaxScrollProperty { get; } = DependencyProperty.Register( + private static DependencyProperty VerticalMaxScrollProperty { get; } = DependencyProperty.Register( nameof(VerticalMaxScroll), typeof(double), typeof(ZoomContentControl), new PropertyMetadata(default(double))); /// Gets or sets the maximum vertical scroll limit. - public double VerticalMaxScroll + private double VerticalMaxScroll { get => (double)GetValue(VerticalMaxScrollProperty); set => SetValue(VerticalMaxScrollProperty, value); } #endregion - #region DependencyProperty: VerticalMinScroll + #region DependencyProperty: [Private] VerticalMinScroll /// Identifies the VerticalMinScroll dependency property. - public static DependencyProperty VerticalMinScrollProperty { get; } = DependencyProperty.Register( + private static DependencyProperty VerticalMinScrollProperty { get; } = DependencyProperty.Register( nameof(VerticalMinScroll), typeof(double), typeof(ZoomContentControl), new PropertyMetadata(default(double))); /// Gets or sets the minimum vertical scroll limit. - public double VerticalMinScroll + private double VerticalMinScroll { get => (double)GetValue(VerticalMinScrollProperty); set => SetValue(VerticalMinScrollProperty, value); } #endregion - #region DependencyProperty: VerticalZoomCenter + #region DependencyProperty: [Private] VerticalZoomCenter /// Identifies the VerticalZoomCenter dependency property. - public static DependencyProperty VerticalZoomCenterProperty { get; } = DependencyProperty.Register( + private static DependencyProperty VerticalZoomCenterProperty { get; } = DependencyProperty.Register( nameof(VerticalZoomCenter), typeof(double), typeof(ZoomContentControl), new PropertyMetadata(default(double))); /// Gets or sets the vertical center point for zooming. - public double VerticalZoomCenter + private double VerticalZoomCenter { get => (double)GetValue(VerticalZoomCenterProperty); set => SetValue(VerticalZoomCenterProperty, value); } #endregion - #region DependencyProperty: IsVerticalScrollBarVisible + #region DependencyProperty: [Private] IsVerticalScrollBarVisible /// Identifies the IsVerticalScrollBarVisible dependency property. - public static DependencyProperty IsVerticalScrollBarVisibleProperty { get; } = DependencyProperty.Register( + private static DependencyProperty IsVerticalScrollBarVisibleProperty { get; } = DependencyProperty.Register( nameof(IsVerticalScrollBarVisible), typeof(bool), typeof(ZoomContentControl), new PropertyMetadata(true)); /// Gets or sets a value indicating whether the vertical scrollbar is visible. - public bool IsVerticalScrollBarVisible + private bool IsVerticalScrollBarVisible { get => (bool)GetValue(IsVerticalScrollBarVisibleProperty); set => SetValue(IsVerticalScrollBarVisibleProperty, value); @@ -203,51 +203,51 @@ public bool IsVerticalScrollBarVisible #endregion - #region DependencyProperty: ZoomLevel + #region DependencyProperty: [Private] ZoomLevel /// Identifies the ZoomLevel dependency property. - public static DependencyProperty ZoomLevelProperty { get; } = DependencyProperty.Register( + private static DependencyProperty ZoomLevelProperty { get; } = DependencyProperty.Register( nameof(ZoomLevel), typeof(double), typeof(ZoomContentControl), new PropertyMetadata(1d, OnZoomLevelChanged)); /// Gets or sets the current zoom level. - public double ZoomLevel + private double ZoomLevel { get => (double)GetValue(ZoomLevelProperty); set => SetValue(ZoomLevelProperty, value); } #endregion - #region DependencyProperty: MinZoomLevel + #region DependencyProperty: [Private] MinZoomLevel /// Identifies the MinZoomLevel dependency property. - public static DependencyProperty MinZoomLevelProperty { get; } = DependencyProperty.Register( + private static DependencyProperty MinZoomLevelProperty { get; } = DependencyProperty.Register( nameof(MinZoomLevel), typeof(double), typeof(ZoomContentControl), new PropertyMetadata(default(double), OnMinZoomLevelChanged)); /// Gets or sets the minimum zoom level allowed. - public double MinZoomLevel + private double MinZoomLevel { get => (double)GetValue(MinZoomLevelProperty); set => SetValue(MinZoomLevelProperty, value); } #endregion - #region DependencyProperty: MaxZoomLevel + #region DependencyProperty: [Private] MaxZoomLevel /// Identifies the MaxZoomLevel dependency property. - public static DependencyProperty MaxZoomLevelProperty { get; } = DependencyProperty.Register( + private static DependencyProperty MaxZoomLevelProperty { get; } = DependencyProperty.Register( nameof(MaxZoomLevel), typeof(double), typeof(ZoomContentControl), new PropertyMetadata(10d, OnMaxZoomLevelChanged)); /// Gets or sets the maximum zoom level allowed. - public double MaxZoomLevel + private double MaxZoomLevel { get => (double)GetValue(MaxZoomLevelProperty); set => SetValue(MaxZoomLevelProperty, value);