Skip to content

Commit 8b77392

Browse files
committed
Refactor 5
1 parent 452e6af commit 8b77392

File tree

2 files changed

+119
-178
lines changed

2 files changed

+119
-178
lines changed

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

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,68 +23,52 @@ public partial class RingShape : Path
2323
{
2424
protected virtual void OnStartAngleChanged(double oldValue, double newValue)
2525
{
26-
BeginUpdate();
27-
ValidateAngle();
28-
EndUpdate();
26+
UpdatePath();
2927
}
3028

3129
protected virtual void OnEndAngleChanged(double oldValue, double newValue)
3230
{
33-
BeginUpdate();
34-
ValidateAngle();
35-
EndUpdate();
31+
UpdatePath();
3632
}
3733

3834
protected virtual void OnSweepDirectionChanged(SweepDirection oldValue, SweepDirection newValue)
3935
{
40-
BeginUpdate();
41-
EndUpdate();
36+
UpdatePath();
4237
}
4338

4439
protected virtual void OnMinAngleChanged(double oldValue, double newValue)
4540
{
46-
BeginUpdate();
47-
CalculateNormalizedAngles();
48-
EndUpdate();
41+
UpdatePath();
4942
}
5043

5144
protected virtual void OnMaxAngleChanged(double oldValue, double newValue)
5245
{
53-
BeginUpdate();
54-
CalculateNormalizedAngles();
55-
EndUpdate();
46+
UpdatePath();
5647
}
5748

5849
protected virtual void OnRadiusWidthChanged(double oldValue, double newValue)
5950
{
60-
BeginUpdate();
61-
ValidateRadius();
62-
EndUpdate();
51+
UpdatePath();
6352
}
6453

6554
protected virtual void OnRadiusHeightChanged(double oldValue, double newValue)
6655
{
67-
BeginUpdate();
68-
ValidateRadius();
69-
EndUpdate();
56+
UpdatePath();
7057
}
7158

7259
protected virtual void OnIsCircleChanged(bool oldValue, bool newValue)
7360
{
74-
BeginUpdate();
75-
EndUpdate();
61+
UpdatePath();
7662
}
7763

7864
private void RingShape_SizeChanged(object obj, SizeChangedEventArgs e)
7965
{
80-
BeginUpdate();
81-
EndUpdate();
66+
UpdatePath();
8267
}
8368

8469
private void OnStrokeThicknessChanged(DependencyObject d, DependencyProperty dp)
8570
{
86-
BeginUpdate();
87-
EndUpdate();
71+
UpdatePath();
8872
}
8973
}
9074
}

0 commit comments

Comments
 (0)