Skip to content

Commit

Permalink
chore: update docs and private properties
Browse files Browse the repository at this point in the history
  • Loading branch information
vatsashah45 committed Oct 22, 2024
1 parent d909908 commit 7703b13
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 50 deletions.
17 changes: 6 additions & 11 deletions doc/controls/ZoomContentControl.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.|
Original file line number Diff line number Diff line change
Expand Up @@ -35,219 +35,219 @@ 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

/// <summary>Identifies the HorizontalMinScroll dependency property.</summary>
public static DependencyProperty HorizontalMinScrollProperty { get; } = DependencyProperty.Register(
private static DependencyProperty HorizontalMinScrollProperty { get; } = DependencyProperty.Register(
nameof(HorizontalMinScroll),
typeof(double),
typeof(ZoomContentControl),
new PropertyMetadata(default(double)));

/// <summary>Gets or sets the minimum horizontal scroll limit.</summary>
public double HorizontalMinScroll
private double HorizontalMinScroll
{
get => (double)GetValue(HorizontalMinScrollProperty);
set => SetValue(HorizontalMinScrollProperty, value);
}

#endregion
#region DependencyProperty: HorizontalMaxScroll
#region DependencyProperty: [Private] HorizontalMaxScroll

/// <summary>Identifies the HorizontalMaxScroll dependency property.</summary>
public static DependencyProperty HorizontalMaxScrollProperty { get; } = DependencyProperty.Register(
private static DependencyProperty HorizontalMaxScrollProperty { get; } = DependencyProperty.Register(
nameof(HorizontalMaxScroll),
typeof(double),
typeof(ZoomContentControl),
new PropertyMetadata(default(double)));

/// <summary>Gets or sets the maximum horizontal scroll limit.</summary>
public double HorizontalMaxScroll
private double HorizontalMaxScroll
{
get => (double)GetValue(HorizontalMaxScrollProperty);
set => SetValue(HorizontalMaxScrollProperty, value);
}

#endregion
#region DependencyProperty: HorizontalZoomCenter
#region DependencyProperty: [Private] HorizontalZoomCenter

/// <summary>Identifies the HorizontalZoomCenter dependency property.</summary>
public static DependencyProperty HorizontalZoomCenterProperty { get; } = DependencyProperty.Register(
private static DependencyProperty HorizontalZoomCenterProperty { get; } = DependencyProperty.Register(
nameof(HorizontalZoomCenter),
typeof(double),
typeof(ZoomContentControl),
new PropertyMetadata(default(double)));

/// <summary>Gets or sets the horizontal center point for zooming.</summary>
public double HorizontalZoomCenter
private double HorizontalZoomCenter
{
get => (double)GetValue(HorizontalZoomCenterProperty);
set => SetValue(HorizontalZoomCenterProperty, value);
}

#endregion
#region DependencyProperty: IsHorizontalScrollBarVisible
#region DependencyProperty: [Private] IsHorizontalScrollBarVisible

/// <summary>Identifies the IsHorizontalScrollBarVisible dependency property.</summary>
public static DependencyProperty IsHorizontalScrollBarVisibleProperty { get; } = DependencyProperty.Register(
private static DependencyProperty IsHorizontalScrollBarVisibleProperty { get; } = DependencyProperty.Register(
nameof(IsHorizontalScrollBarVisible),
typeof(bool),
typeof(ZoomContentControl),
new PropertyMetadata(true));

/// <summary>Gets or sets a value indicating whether the horizontal scrollbar is visible.</summary>
public bool IsHorizontalScrollBarVisible
private bool IsHorizontalScrollBarVisible
{
get => (bool)GetValue(IsHorizontalScrollBarVisibleProperty);
set => SetValue(IsHorizontalScrollBarVisibleProperty, value);
}

#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

/// <summary>Identifies the VerticalMaxScroll dependency property.</summary>
public static DependencyProperty VerticalMaxScrollProperty { get; } = DependencyProperty.Register(
private static DependencyProperty VerticalMaxScrollProperty { get; } = DependencyProperty.Register(
nameof(VerticalMaxScroll),
typeof(double),
typeof(ZoomContentControl),
new PropertyMetadata(default(double)));

/// <summary>Gets or sets the maximum vertical scroll limit.</summary>
public double VerticalMaxScroll
private double VerticalMaxScroll
{
get => (double)GetValue(VerticalMaxScrollProperty);
set => SetValue(VerticalMaxScrollProperty, value);
}

#endregion
#region DependencyProperty: VerticalMinScroll
#region DependencyProperty: [Private] VerticalMinScroll

/// <summary>Identifies the VerticalMinScroll dependency property.</summary>
public static DependencyProperty VerticalMinScrollProperty { get; } = DependencyProperty.Register(
private static DependencyProperty VerticalMinScrollProperty { get; } = DependencyProperty.Register(
nameof(VerticalMinScroll),
typeof(double),
typeof(ZoomContentControl),
new PropertyMetadata(default(double)));

/// <summary>Gets or sets the minimum vertical scroll limit.</summary>
public double VerticalMinScroll
private double VerticalMinScroll
{
get => (double)GetValue(VerticalMinScrollProperty);
set => SetValue(VerticalMinScrollProperty, value);
}

#endregion
#region DependencyProperty: VerticalZoomCenter
#region DependencyProperty: [Private] VerticalZoomCenter

/// <summary>Identifies the VerticalZoomCenter dependency property.</summary>
public static DependencyProperty VerticalZoomCenterProperty { get; } = DependencyProperty.Register(
private static DependencyProperty VerticalZoomCenterProperty { get; } = DependencyProperty.Register(
nameof(VerticalZoomCenter),
typeof(double),
typeof(ZoomContentControl),
new PropertyMetadata(default(double)));

/// <summary>Gets or sets the vertical center point for zooming.</summary>
public double VerticalZoomCenter
private double VerticalZoomCenter
{
get => (double)GetValue(VerticalZoomCenterProperty);
set => SetValue(VerticalZoomCenterProperty, value);
}

#endregion
#region DependencyProperty: IsVerticalScrollBarVisible
#region DependencyProperty: [Private] IsVerticalScrollBarVisible

/// <summary>Identifies the IsVerticalScrollBarVisible dependency property.</summary>
public static DependencyProperty IsVerticalScrollBarVisibleProperty { get; } = DependencyProperty.Register(
private static DependencyProperty IsVerticalScrollBarVisibleProperty { get; } = DependencyProperty.Register(
nameof(IsVerticalScrollBarVisible),
typeof(bool),
typeof(ZoomContentControl),
new PropertyMetadata(true));

/// <summary>Gets or sets a value indicating whether the vertical scrollbar is visible.</summary>
public bool IsVerticalScrollBarVisible
private bool IsVerticalScrollBarVisible
{
get => (bool)GetValue(IsVerticalScrollBarVisibleProperty);
set => SetValue(IsVerticalScrollBarVisibleProperty, value);
}

#endregion

#region DependencyProperty: ZoomLevel
#region DependencyProperty: [Private] ZoomLevel

/// <summary>Identifies the ZoomLevel dependency property.</summary>
public static DependencyProperty ZoomLevelProperty { get; } = DependencyProperty.Register(
private static DependencyProperty ZoomLevelProperty { get; } = DependencyProperty.Register(
nameof(ZoomLevel),
typeof(double),
typeof(ZoomContentControl),
new PropertyMetadata(1d, OnZoomLevelChanged));

/// <summary>Gets or sets the current zoom level.</summary>
public double ZoomLevel
private double ZoomLevel
{
get => (double)GetValue(ZoomLevelProperty);
set => SetValue(ZoomLevelProperty, value);
}

#endregion
#region DependencyProperty: MinZoomLevel
#region DependencyProperty: [Private] MinZoomLevel

/// <summary>Identifies the MinZoomLevel dependency property.</summary>
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));

/// <summary>Gets or sets the minimum zoom level allowed.</summary>
public double MinZoomLevel
private double MinZoomLevel
{
get => (double)GetValue(MinZoomLevelProperty);
set => SetValue(MinZoomLevelProperty, value);
}

#endregion
#region DependencyProperty: MaxZoomLevel
#region DependencyProperty: [Private] MaxZoomLevel

/// <summary>Identifies the MaxZoomLevel dependency property.</summary>
public static DependencyProperty MaxZoomLevelProperty { get; } = DependencyProperty.Register(
private static DependencyProperty MaxZoomLevelProperty { get; } = DependencyProperty.Register(
nameof(MaxZoomLevel),
typeof(double),
typeof(ZoomContentControl),
new PropertyMetadata(10d, OnMaxZoomLevelChanged));

/// <summary>Gets or sets the maximum zoom level allowed.</summary>
public double MaxZoomLevel
private double MaxZoomLevel
{
get => (double)GetValue(MaxZoomLevelProperty);
set => SetValue(MaxZoomLevelProperty, value);
Expand Down

0 comments on commit 7703b13

Please sign in to comment.