Skip to content

Commit c0f7ff3

Browse files
committed
Renamed trigger
1 parent 41b580a commit c0f7ff3

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Microsoft.Toolkit.Uwp.UI/Triggers/ControlWidthTrigger.cs renamed to Microsoft.Toolkit.Uwp.UI/Triggers/ControlSizeTrigger.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Triggers
88
{
99
/// <summary>
1010
/// A conditional state trigger that functions
11-
/// based on the target control's width.
11+
/// based on the target control's width or height.
1212
/// </summary>
13-
public class ControlWidthTrigger : StateTriggerBase
13+
public class ControlSizeTrigger : StateTriggerBase
1414
{
1515
/// <summary>
1616
/// Gets or sets a value indicating
@@ -28,8 +28,8 @@ public bool CanTrigger
2828
public static readonly DependencyProperty CanTriggerProperty = DependencyProperty.Register(
2929
nameof(CanTrigger),
3030
typeof(bool),
31-
typeof(ControlWidthTrigger),
32-
new PropertyMetadata(true, (d, e) => ((ControlWidthTrigger)d).UpdateTrigger()));
31+
typeof(ControlSizeTrigger),
32+
new PropertyMetadata(true, (d, e) => ((ControlSizeTrigger)d).UpdateTrigger()));
3333

3434
/// <summary>
3535
/// Gets or sets the max width at which to trigger.
@@ -46,8 +46,8 @@ public double MaxWidth
4646
public static readonly DependencyProperty MaxWidthProperty = DependencyProperty.Register(
4747
nameof(MaxWidth),
4848
typeof(double),
49-
typeof(ControlWidthTrigger),
50-
new PropertyMetadata(double.PositiveInfinity, (d, e) => ((ControlWidthTrigger)d).UpdateTrigger()));
49+
typeof(ControlSizeTrigger),
50+
new PropertyMetadata(double.PositiveInfinity, (d, e) => ((ControlSizeTrigger)d).UpdateTrigger()));
5151

5252
/// <summary>
5353
/// Gets or sets the min width at which to trigger.
@@ -64,8 +64,8 @@ public double MinWidth
6464
public static readonly DependencyProperty MinWidthProperty = DependencyProperty.Register(
6565
nameof(MinWidth),
6666
typeof(double),
67-
typeof(ControlWidthTrigger),
68-
new PropertyMetadata(0.0, (d, e) => ((ControlWidthTrigger)d).UpdateTrigger()));
67+
typeof(ControlSizeTrigger),
68+
new PropertyMetadata(0.0, (d, e) => ((ControlSizeTrigger)d).UpdateTrigger()));
6969

7070
/// <summary>
7171
/// Gets or sets the max height at which to trigger.
@@ -82,8 +82,8 @@ public double MaxHeight
8282
public static readonly DependencyProperty MaxHeightProperty = DependencyProperty.Register(
8383
nameof(MaxHeight),
8484
typeof(double),
85-
typeof(ControlWidthTrigger),
86-
new PropertyMetadata(double.PositiveInfinity, (d, e) => ((ControlWidthTrigger)d).UpdateTrigger()));
85+
typeof(ControlSizeTrigger),
86+
new PropertyMetadata(double.PositiveInfinity, (d, e) => ((ControlSizeTrigger)d).UpdateTrigger()));
8787

8888
/// <summary>
8989
/// Gets or sets the min height at which to trigger.
@@ -100,8 +100,8 @@ public double MinHeight
100100
public static readonly DependencyProperty MinHeightProperty = DependencyProperty.Register(
101101
nameof(MinHeight),
102102
typeof(double),
103-
typeof(ControlWidthTrigger),
104-
new PropertyMetadata(0.0, (d, e) => ((ControlWidthTrigger)d).UpdateTrigger()));
103+
typeof(ControlSizeTrigger),
104+
new PropertyMetadata(0.0, (d, e) => ((ControlSizeTrigger)d).UpdateTrigger()));
105105

106106
/// <summary>
107107
/// Gets or sets the element whose width will observed
@@ -122,12 +122,12 @@ public FrameworkElement TargetElement
122122
public static readonly DependencyProperty TargetElementProperty = DependencyProperty.Register(
123123
nameof(TargetElement),
124124
typeof(FrameworkElement),
125-
typeof(ControlWidthTrigger),
125+
typeof(ControlSizeTrigger),
126126
new PropertyMetadata(null, OnTargetElementPropertyChanged));
127127

128128
private static void OnTargetElementPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
129129
{
130-
((ControlWidthTrigger)d).UpdateTargetElement((FrameworkElement)e.OldValue, (FrameworkElement)e.NewValue);
130+
((ControlSizeTrigger)d).UpdateTargetElement((FrameworkElement)e.OldValue, (FrameworkElement)e.NewValue);
131131
}
132132

133133
// Handle event to get current values

0 commit comments

Comments
 (0)