@@ -8,9 +8,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Triggers
8
8
{
9
9
/// <summary>
10
10
/// A conditional state trigger that functions
11
- /// based on the target control's width.
11
+ /// based on the target control's width or height .
12
12
/// </summary>
13
- public class ControlWidthTrigger : StateTriggerBase
13
+ public class ControlSizeTrigger : StateTriggerBase
14
14
{
15
15
/// <summary>
16
16
/// Gets or sets a value indicating
@@ -28,8 +28,8 @@ public bool CanTrigger
28
28
public static readonly DependencyProperty CanTriggerProperty = DependencyProperty . Register (
29
29
nameof ( CanTrigger ) ,
30
30
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 ( ) ) ) ;
33
33
34
34
/// <summary>
35
35
/// Gets or sets the max width at which to trigger.
@@ -46,8 +46,8 @@ public double MaxWidth
46
46
public static readonly DependencyProperty MaxWidthProperty = DependencyProperty . Register (
47
47
nameof ( MaxWidth ) ,
48
48
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 ( ) ) ) ;
51
51
52
52
/// <summary>
53
53
/// Gets or sets the min width at which to trigger.
@@ -64,8 +64,8 @@ public double MinWidth
64
64
public static readonly DependencyProperty MinWidthProperty = DependencyProperty . Register (
65
65
nameof ( MinWidth ) ,
66
66
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 ( ) ) ) ;
69
69
70
70
/// <summary>
71
71
/// Gets or sets the max height at which to trigger.
@@ -82,8 +82,8 @@ public double MaxHeight
82
82
public static readonly DependencyProperty MaxHeightProperty = DependencyProperty . Register (
83
83
nameof ( MaxHeight ) ,
84
84
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 ( ) ) ) ;
87
87
88
88
/// <summary>
89
89
/// Gets or sets the min height at which to trigger.
@@ -100,8 +100,8 @@ public double MinHeight
100
100
public static readonly DependencyProperty MinHeightProperty = DependencyProperty . Register (
101
101
nameof ( MinHeight ) ,
102
102
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 ( ) ) ) ;
105
105
106
106
/// <summary>
107
107
/// Gets or sets the element whose width will observed
@@ -122,12 +122,12 @@ public FrameworkElement TargetElement
122
122
public static readonly DependencyProperty TargetElementProperty = DependencyProperty . Register (
123
123
nameof ( TargetElement ) ,
124
124
typeof ( FrameworkElement ) ,
125
- typeof ( ControlWidthTrigger ) ,
125
+ typeof ( ControlSizeTrigger ) ,
126
126
new PropertyMetadata ( null , OnTargetElementPropertyChanged ) ) ;
127
127
128
128
private static void OnTargetElementPropertyChanged ( DependencyObject d , DependencyPropertyChangedEventArgs e )
129
129
{
130
- ( ( ControlWidthTrigger ) d ) . UpdateTargetElement ( ( FrameworkElement ) e . OldValue , ( FrameworkElement ) e . NewValue ) ;
130
+ ( ( ControlSizeTrigger ) d ) . UpdateTargetElement ( ( FrameworkElement ) e . OldValue , ( FrameworkElement ) e . NewValue ) ;
131
131
}
132
132
133
133
// Handle event to get current values
0 commit comments