Skip to content

Commit 66a937f

Browse files
committed
Refactor 2
1 parent 23e13d5 commit 66a937f

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

src/Files.App.Controls/Storage/RingShape/RingShape.Properties.cs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ public partial class RingShape : Path
2424
protected virtual void OnStartAngleChanged(double oldValue, double newValue)
2525
{
2626
BeginUpdate();
27-
ValidateAngle(this, StartAngle, true);
27+
StartAngle = ValidateAngle(StartAngle);
2828
EndUpdate();
2929
}
3030

3131
protected virtual void OnEndAngleChanged(double oldValue, double newValue)
3232
{
3333
BeginUpdate();
34-
ValidateAngle(this, EndAngle, false);
34+
EndAngle = ValidateAngle(EndAngle);
3535
EndUpdate();
3636
}
3737

@@ -44,28 +44,28 @@ protected virtual void OnSweepDirectionChanged(SweepDirection oldValue, SweepDir
4444
protected virtual void OnMinAngleChanged(double oldValue, double newValue)
4545
{
4646
BeginUpdate();
47-
CalculateAndSetNormalizedAngles(this, MinAngle, MaxAngle);
47+
CalculateAndSetNormalizedAngles();
4848
EndUpdate();
4949
}
5050

5151
protected virtual void OnMaxAngleChanged(double oldValue, double newValue)
5252
{
5353
BeginUpdate();
54-
CalculateAndSetNormalizedAngles(this, MinAngle, MaxAngle);
54+
CalculateAndSetNormalizedAngles();
5555
EndUpdate();
5656
}
5757

5858
protected virtual void OnRadiusWidthChanged(double oldValue, double newValue)
5959
{
6060
BeginUpdate();
61-
AdjustRadiusWidth(this, RadiusWidth, StrokeThickness);
61+
AdjustRadiusWidth();
6262
EndUpdate();
6363
}
6464

6565
protected virtual void OnRadiusHeightChanged(double oldValue, double newValue)
6666
{
6767
BeginUpdate();
68-
AdjustRadiusHeight(this, RadiusHeight, StrokeThickness);
68+
AdjustRadiusHeight();
6969
EndUpdate();
7070
}
7171

@@ -74,5 +74,17 @@ protected virtual void OnIsCircleChanged(bool oldValue, bool newValue)
7474
BeginUpdate();
7575
EndUpdate();
7676
}
77+
78+
private void RingShape_SizeChanged(object obj, SizeChangedEventArgs e)
79+
{
80+
BeginUpdate();
81+
EndUpdate();
82+
}
83+
84+
private void OnStrokeThicknessChanged(DependencyObject d, DependencyProperty dp)
85+
{
86+
BeginUpdate();
87+
EndUpdate();
88+
}
7789
}
7890
}

src/Files.App.Controls/Storage/RingShape/RingShape.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,6 @@ public RingShape()
4141
RegisterPropertyChangedCallback(StrokeThicknessProperty, OnStrokeThicknessChanged);
4242
}
4343

44-
#region PropertyChanged Events
45-
46-
private void RingShape_SizeChanged(object obj, SizeChangedEventArgs e)
47-
{
48-
BeginUpdate();
49-
EndUpdate();
50-
}
51-
52-
private void OnStrokeThicknessChanged(DependencyObject d, DependencyProperty dp)
53-
{
54-
BeginUpdate();
55-
EndUpdate();
56-
}
57-
58-
#endregion
59-
6044
#region RingShape Path Updates
6145

6246
/// <summary>

0 commit comments

Comments
 (0)