2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
+ using System ;
5
6
using Windows . Foundation . Collections ;
6
7
using Windows . UI . Xaml ;
7
8
using Windows . UI . Xaml . Hosting ;
@@ -130,7 +131,7 @@ public static void SetAnimations(UIElement element, ImplicitAnimationSet value)
130
131
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
131
132
private static void OnShowAnimationsPropertyChanged ( DependencyObject d , DependencyPropertyChangedEventArgs e )
132
133
{
133
- static void OnAnimationsChanged ( IObservableVector < DependencyObject > sender , IVectorChangedEventArgs args )
134
+ static void OnAnimationsChanged ( object sender , EventArgs e )
134
135
{
135
136
var collection = ( ImplicitAnimationSet ) sender ;
136
137
@@ -142,15 +143,15 @@ static void OnAnimationsChanged(IObservableVector<DependencyObject> sender, IVec
142
143
143
144
if ( e . OldValue is ImplicitAnimationSet oldCollection )
144
145
{
145
- oldCollection . VectorChanged -= OnAnimationsChanged ;
146
+ oldCollection . AnimationsChanged -= OnAnimationsChanged ;
146
147
}
147
148
148
149
if ( d is UIElement element &&
149
150
e . NewValue is ImplicitAnimationSet collection )
150
151
{
151
152
collection . ParentReference = new ( element ) ;
152
- collection . VectorChanged -= OnAnimationsChanged ;
153
- collection . VectorChanged += OnAnimationsChanged ;
153
+ collection . AnimationsChanged -= OnAnimationsChanged ;
154
+ collection . AnimationsChanged += OnAnimationsChanged ;
154
155
155
156
ElementCompositionPreview . SetIsTranslationEnabled ( element , true ) ;
156
157
ElementCompositionPreview . SetImplicitShowAnimation ( element , collection . GetCompositionAnimationGroup ( ) ) ;
@@ -164,7 +165,7 @@ static void OnAnimationsChanged(IObservableVector<DependencyObject> sender, IVec
164
165
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
165
166
private static void OnHideAnimationsPropertyChanged ( DependencyObject d , DependencyPropertyChangedEventArgs e )
166
167
{
167
- static void OnAnimationsChanged ( IObservableVector < DependencyObject > sender , IVectorChangedEventArgs args )
168
+ static void OnAnimationsChanged ( object sender , EventArgs e )
168
169
{
169
170
var collection = ( ImplicitAnimationSet ) sender ;
170
171
@@ -176,15 +177,15 @@ static void OnAnimationsChanged(IObservableVector<DependencyObject> sender, IVec
176
177
177
178
if ( e . OldValue is ImplicitAnimationSet oldCollection )
178
179
{
179
- oldCollection . VectorChanged -= OnAnimationsChanged ;
180
+ oldCollection . AnimationsChanged -= OnAnimationsChanged ;
180
181
}
181
182
182
183
if ( d is UIElement element &&
183
184
e . NewValue is ImplicitAnimationSet collection )
184
185
{
185
186
collection . ParentReference = new ( element ) ;
186
- collection . VectorChanged -= OnAnimationsChanged ;
187
- collection . VectorChanged += OnAnimationsChanged ;
187
+ collection . AnimationsChanged -= OnAnimationsChanged ;
188
+ collection . AnimationsChanged += OnAnimationsChanged ;
188
189
189
190
ElementCompositionPreview . SetIsTranslationEnabled ( element , true ) ;
190
191
ElementCompositionPreview . SetImplicitHideAnimation ( element , collection . GetCompositionAnimationGroup ( ) ) ;
@@ -198,7 +199,7 @@ static void OnAnimationsChanged(IObservableVector<DependencyObject> sender, IVec
198
199
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
199
200
private static void OnAnimationsPropertyChanged ( DependencyObject d , DependencyPropertyChangedEventArgs e )
200
201
{
201
- static void OnAnimationsChanged ( IObservableVector < DependencyObject > sender , IVectorChangedEventArgs args )
202
+ static void OnAnimationsChanged ( object sender , EventArgs e )
202
203
{
203
204
var collection = ( ImplicitAnimationSet ) sender ;
204
205
@@ -210,15 +211,15 @@ static void OnAnimationsChanged(IObservableVector<DependencyObject> sender, IVec
210
211
211
212
if ( e . OldValue is ImplicitAnimationSet oldCollection )
212
213
{
213
- oldCollection . VectorChanged -= OnAnimationsChanged ;
214
+ oldCollection . AnimationsChanged -= OnAnimationsChanged ;
214
215
}
215
216
216
217
if ( d is UIElement element &&
217
218
e . NewValue is ImplicitAnimationSet collection )
218
219
{
219
220
collection . ParentReference = new ( element ) ;
220
- collection . VectorChanged -= OnAnimationsChanged ;
221
- collection . VectorChanged += OnAnimationsChanged ;
221
+ collection . AnimationsChanged -= OnAnimationsChanged ;
222
+ collection . AnimationsChanged += OnAnimationsChanged ;
222
223
223
224
ElementCompositionPreview . SetIsTranslationEnabled ( element , true ) ;
224
225
ElementCompositionPreview . GetElementVisual ( element ) . ImplicitAnimations = collection . GetImplicitAnimationCollection ( ) ;
0 commit comments