@@ -26,7 +26,9 @@ public PlayerAnimationOptimization AnimationOptimization
26
26
nameof ( AnimationOptimization ) ,
27
27
typeof ( PlayerAnimationOptimization ) ,
28
28
typeof ( AnimatedVisualPlayer ) ,
29
- new FrameworkPropertyMetadata ( PlayerAnimationOptimization . Latency ) ) ;
29
+ new FrameworkPropertyMetadata (
30
+ PlayerAnimationOptimization . Latency ,
31
+ ( sender , args ) => ( ( AnimatedVisualPlayer ) sender ) . OnAnimationOptimizationPropertyChanged ( args ) ) ;
30
32
31
33
/// <summary>
32
34
/// Gets or sets a value that indicates whether an animated visual plays immediately when it is loaded.
@@ -45,12 +47,18 @@ public bool AutoPlay
45
47
nameof ( AutoPlay ) ,
46
48
typeof ( bool ) ,
47
49
typeof ( AnimatedVisualPlayer ) ,
48
- new FrameworkPropertyMetadata ( true ) ) ;
50
+ new FrameworkPropertyMetadata (
51
+ true ,
52
+ ( sender , args ) => ( ( AnimatedVisualPlayer ) sender ) . OnAutoPlayPropertyChanged ( args ) ) ) ;
49
53
50
54
/// <summary>
51
55
/// Gets optional diagnostics information about the last attempt to load an animated visual.
52
56
/// </summary>
53
- public object Diagnostics => GetValue ( DiagnosticsProperty ) ;
57
+ public object Diagnostics
58
+ {
59
+ get => GetValue ( DiagnosticsProperty ) ;
60
+ private set => SetValue ( DiagnosticsProperty , value ) ;
61
+ }
54
62
55
63
/// <summary>
56
64
/// Identifies the Diagnostics dependency property.
@@ -65,7 +73,11 @@ public bool AutoPlay
65
73
/// <summary>
66
74
/// Gets the duration of the the currently loaded animated visual, or TimeSpan.Zero if no animated visual is loaded.
67
75
/// </summary>
68
- public TimeSpan Duration => ( TimeSpan ) GetValue ( DurationProperty ) ;
76
+ public TimeSpan Duration
77
+ {
78
+ get => ( TimeSpan ) GetValue ( DurationProperty ) ;
79
+ private set => SetValue ( DurationProperty , value ) ;
80
+ }
69
81
70
82
/// <summary>
71
83
/// Identifies the Duration dependency property.
@@ -94,12 +106,18 @@ public DataTemplate FallbackContent
94
106
nameof ( FallbackContent ) ,
95
107
typeof ( DataTemplate ) ,
96
108
typeof ( AnimatedVisualPlayer ) ,
97
- new FrameworkPropertyMetadata ( null ) ) ;
109
+ new FrameworkPropertyMetadata (
110
+ null ,
111
+ ( sender , args ) => ( ( AnimatedVisualPlayer ) sender ) . OnFallbackContentPropertyChanged ( args ) ) ) ;
98
112
99
113
/// <summary>
100
114
/// Gets a value that indicates whether an animated visual is loaded.
101
115
/// </summary>
102
- public bool IsAnimatedVisualLoaded => ( bool ) GetValue ( IsAnimatedVisualLoadedProperty ) ;
116
+ public bool IsAnimatedVisualLoaded
117
+ {
118
+ get => ( bool ) GetValue ( IsAnimatedVisualLoadedProperty ) ;
119
+ private set => SetValue ( IsAnimatedVisualLoadedProperty , value ) ;
120
+ }
103
121
104
122
/// <summary>
105
123
/// Identifies the IsAnimatedVisualLoaded dependency property.
@@ -139,7 +157,9 @@ public double PlaybackRate
139
157
nameof ( PlaybackRate ) ,
140
158
typeof ( double ) ,
141
159
typeof ( AnimatedVisualPlayer ) ,
142
- new FrameworkPropertyMetadata ( 1.0 ) ) ;
160
+ new FrameworkPropertyMetadata (
161
+ 1.0 ,
162
+ ( sender , args ) => ( ( AnimatedVisualPlayer ) sender ) . OnPlaybackRatePropertyChanged ( args ) ) ) ;
143
163
144
164
/// <summary>
145
165
/// Gets or sets the provider of the animated visual for the player.
@@ -158,7 +178,9 @@ public IAnimatedVisualSource Source
158
178
nameof ( Source ) ,
159
179
typeof ( IAnimatedVisualSource ) ,
160
180
typeof ( AnimatedVisualPlayer ) ,
161
- new FrameworkPropertyMetadata ( null ) ) ;
181
+ new FrameworkPropertyMetadata (
182
+ null ,
183
+ ( sender , args ) => ( ( AnimatedVisualPlayer ) sender ) . OnSourcePropertyChanged ( args ) ) ) ;
162
184
163
185
/// <summary>
164
186
/// Gets or sets a value that describes how an animated visual should be stretched to fill the destination rectangle.
@@ -177,5 +199,7 @@ public Stretch Stretch
177
199
nameof ( Stretch ) ,
178
200
typeof ( Stretch ) ,
179
201
typeof ( AnimatedVisualPlayer ) ,
180
- new FrameworkPropertyMetadata ( Stretch . Uniform ) ) ;
202
+ new FrameworkPropertyMetadata (
203
+ Stretch . Uniform ,
204
+ ( sender , args ) => ( ( AnimatedVisualPlayer ) sender ) . OnStretchPropertyChanged ( args ) ) ) ;
181
205
}
0 commit comments