Skip to content

Commit

Permalink
chore: minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoy312 committed Oct 17, 2024
1 parent 0be5c7a commit f8e4153
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ private void OnZoomOutClick(object sender, RoutedEventArgs e)

private void OnResetClick(object sender, RoutedEventArgs e)
{
zoomControl.Initialize();
zoomControl.ResetViewport();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public double HorizontalOffset
}

#endregion

#region DependencyProperty: HorizontalScrollValue

/// <summary>Identifies the HorizontalScrollValue dependency property.</summary>
Expand All @@ -70,7 +69,6 @@ public double HorizontalScrollValue
}

#endregion

#region DependencyProperty: HorizontalMinScroll

/// <summary>Identifies the HorizontalMinScroll dependency property.</summary>
Expand All @@ -88,7 +86,6 @@ public double HorizontalMinScroll
}

#endregion

#region DependencyProperty: HorizontalMaxScroll

/// <summary>Identifies the HorizontalMaxScroll dependency property.</summary>
Expand All @@ -106,7 +103,6 @@ public double HorizontalMaxScroll
}

#endregion

#region DependencyProperty: HorizontalZoomCenter

/// <summary>Identifies the HorizontalZoomCenter dependency property.</summary>
Expand Down Expand Up @@ -142,7 +138,6 @@ public double VerticalOffset
}

#endregion

#region DependencyProperty: VerticalMaxScroll

/// <summary>Identifies the VerticalMaxScroll dependency property.</summary>
Expand All @@ -160,7 +155,6 @@ public double VerticalMaxScroll
}

#endregion

#region DependencyProperty: VerticalMinScroll

/// <summary>Identifies the VerticalMinScroll dependency property.</summary>
Expand All @@ -178,7 +172,6 @@ public double VerticalMinScroll
}

#endregion

#region DependencyProperty: VerticalZoomCenter

/// <summary>Identifies the VerticalZoomCenter dependency property.</summary>
Expand All @@ -197,42 +190,6 @@ public double VerticalZoomCenter

#endregion

#region DependencyProperty: ViewportWidth

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

/// <summary>Gets or sets the width of the viewport.</summary>
public double ViewportWidth
{
get => (double)GetValue(ViewportWidthProperty);
set => SetValue(ViewportWidthProperty, value);
}

#endregion

#region DependencyProperty: ViewportHeight

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

/// <summary>Gets or sets the height of the viewport.</summary>
public double ViewportHeight
{
get => (double)GetValue(ViewportHeightProperty);
set => SetValue(ViewportHeightProperty, value);
}

#endregion

#region DependencyProperty: ZoomLevel

/// <summary>Identifies the ZoomLevel dependency property.</summary>
Expand All @@ -250,7 +207,6 @@ public double ZoomLevel
}

#endregion

#region DependencyProperty: MinZoomLevel

/// <summary>Identifies the MinZoomLevel dependency property.</summary>
Expand All @@ -268,7 +224,6 @@ public double MinZoomLevel
}

#endregion

#region DependencyProperty: MaxZoomLevel

/// <summary>Identifies the MaxZoomLevel dependency property.</summary>
Expand Down Expand Up @@ -304,7 +259,6 @@ public double PanWheelRatio
}

#endregion

#region DependencyProperty: ScaleWheelRatio

/// <summary>Identifies the ScaleWheelRatio dependency property.</summary>
Expand All @@ -323,6 +277,41 @@ public double ScaleWheelRatio

#endregion

#region DependencyProperty: ViewportWidth

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

/// <summary>Gets or sets the width of the viewport.</summary>
public double ViewportWidth
{
get => (double)GetValue(ViewportWidthProperty);
set => SetValue(ViewportWidthProperty, value);
}

#endregion
#region DependencyProperty: ViewportHeight

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

/// <summary>Gets or sets the height of the viewport.</summary>
public double ViewportHeight
{
get => (double)GetValue(ViewportHeightProperty);
set => SetValue(ViewportHeightProperty, value);
}

#endregion

#region DependencyProperty: IsActive

/// <summary>Identifies the IsActive dependency property.</summary>
Expand All @@ -340,7 +329,6 @@ public bool IsActive
}

#endregion

#region DependencyProperty: IsZoomAllowed

/// <summary>Identifies the IsZoomAllowed dependency property.</summary>
Expand All @@ -358,7 +346,6 @@ public bool IsZoomAllowed
}

#endregion

#region DependencyProperty: IsHorizontalScrollBarVisible

/// <summary>Identifies the IsHorizontalScrollBarVisible dependency property.</summary>
Expand All @@ -376,7 +363,6 @@ public bool IsHorizontalScrollBarVisible
}

#endregion

#region DependencyProperty: IsPanAllowed

/// <summary>Identifies the IsPanAllowed dependency property.</summary>
Expand All @@ -394,7 +380,6 @@ public bool IsPanAllowed
}

#endregion

#region DependencyProperty: IsVerticalScrollBarVisible

/// <summary>Identifies the IsVerticalScrollBarVisible dependency property.</summary>
Expand All @@ -412,7 +397,6 @@ public bool IsVerticalScrollBarVisible
}

#endregion

#region DependencyProperty: AutoZoomToCanvasOnSizeChanged

/// <summary>Identifies the AutoZoomToCanvasOnSizeChanged dependency property.</summary>
Expand All @@ -430,7 +414,6 @@ public bool AutoZoomToCanvasOnSizeChanged
}

#endregion

#region DependencyProperty: AdditionalMargin

/// <summary>Identifies the AdditionalMargin dependency property.</summary>
Expand All @@ -448,7 +431,6 @@ public Thickness AdditionalMargin
}

#endregion

#region DependencyProperty: ContentBoundsVisibility

/// <summary>Identifies the ContentBoundsVisibility dependency property.</summary>
Expand Down
Loading

0 comments on commit f8e4153

Please sign in to comment.