forked from lepoco/wpfui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,21 +7,28 @@ | |
using System.Windows.Shapes; | ||
using Point = System.Windows.Point; | ||
using Size = System.Windows.Size; | ||
#pragma warning disable SA1124 | ||
// ReSharper disable CheckNamespace | ||
Check warning on line 10 in src/Wpf.Ui/Controls/Arc/Arc.cs GitHub Actions / build
|
||
#pragma warning disable CS0108 | ||
|
||
namespace Wpf.Ui.Controls; | ||
|
||
/// <summary> | ||
/// Control that draws a symmetrical arc with rounded edges. | ||
/// </summary> | ||
/// <example> | ||
/// <code lang="xml"> | ||
/// <ui:Arc | ||
/// EndAngle="359" | ||
/// StartAngle="0" | ||
/// Stroke="{ui:ThemeResource SystemAccentColorSecondaryBrush}" | ||
/// StrokeThickness="2" | ||
/// Visibility="Visible" /> | ||
/// </code> | ||
/// </example> | ||
public class Arc : Shape | ||
{ | ||
#region Declarations | ||
|
||
private Viewbox? _rootLayout; | ||
|
||
#endregion | ||
|
||
#region Static Properties | ||
|
||
/// <summary>Identifies the <see cref="StartAngle"/> dependency property.</summary> | ||
public static readonly DependencyProperty StartAngleProperty = DependencyProperty.Register( | ||
nameof(StartAngle), | ||
|
@@ -56,10 +63,6 @@ public class Arc : Shape | |
new PropertyMetadata(PenLineCap.Round, PropertyChangedCallback) | ||
); | ||
|
||
#endregion | ||
|
||
#region Public Properties | ||
|
||
/// <summary> | ||
/// Gets or sets the initial angle from which the arc will be drawn. | ||
/// </summary> | ||
|
@@ -98,10 +101,6 @@ public PenLineCap StrokeStartLineCap | |
/// </summary> | ||
public bool IsLargeArc { get; internal set; } = false; | ||
|
||
#endregion | ||
|
||
#region Private Methods | ||
|
||
private void EnsureRootLayout() | ||
{ | ||
if (_rootLayout != null) | ||
|
@@ -113,10 +112,6 @@ private void EnsureRootLayout() | |
AddVisualChild(_rootLayout); | ||
} | ||
|
||
#endregion | ||
|
||
#region Protected Methods | ||
|
||
/// <inheritdoc /> | ||
protected override Geometry DefiningGeometry => DefinedGeometry(); | ||
|
||
|
@@ -244,6 +239,4 @@ protected override void OnRender(DrawingContext drawingContext) | |
|
||
drawingContext.DrawGeometry(Stroke, pen, DefinedGeometry()); | ||
} | ||
|
||
#endregion | ||
} |