Moved the ScrollViewer expression animation extensions
This commit is contained in:
Родитель
7262c7c97f
Коммит
cedbbf73b0
|
@ -4,6 +4,8 @@
|
|||
|
||||
using System.Collections.ObjectModel;
|
||||
using Microsoft.Toolkit.Uwp.SampleApp.Models;
|
||||
using Microsoft.Toolkit.Uwp.UI.Animations;
|
||||
using Microsoft.Toolkit.Uwp.UI.Animations.Extensions;
|
||||
using Microsoft.Toolkit.Uwp.UI.Extensions;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
|
|
@ -22,7 +22,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
/// <summary>
|
||||
/// The Z axis (depth).
|
||||
/// </summary>
|
||||
/// <remarks>This axis might only be available in certain scenarios, such as when working with composition APIs.</remarks>
|
||||
/// <remarks>
|
||||
/// This axis might only be available in certain scenarios, such as when working with composition APIs.
|
||||
/// </remarks>
|
||||
Z
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using Windows.UI.Composition;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Extensions
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Animations
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates a property of a <see cref="Visual"/> object.
|
|
@ -2,14 +2,14 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using Microsoft.Toolkit.Diagnostics;
|
||||
using Windows.UI.Composition;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Hosting;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Extensions
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Animations.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides attached dependency properties and methods for the <see cref="ScrollViewer"/> control.
|
||||
|
@ -50,7 +50,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Extensions
|
|||
VisualProperty property = VisualProperty.Translation)
|
||||
{
|
||||
CompositionPropertySet scrollSet = ElementCompositionPreview.GetScrollViewerManipulationPropertySet(scroller);
|
||||
|
||||
ExpressionAnimation animation = scrollSet.Compositor.CreateExpressionAnimation($"{nameof(scroller)}.{nameof(UIElement.Translation)}.{sourceAxis}");
|
||||
|
||||
animation.SetReferenceParameter(nameof(scroller), scrollSet);
|
||||
|
@ -66,7 +65,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Extensions
|
|||
case VisualProperty.Offset:
|
||||
visual.StartAnimation($"{nameof(Visual.Offset)}.{targetAxis}", animation);
|
||||
break;
|
||||
default: throw new ArgumentException($"Invalid target property: {property}", nameof(property));
|
||||
default:
|
||||
ThrowHelper.ThrowArgumentException("Invalid target property");
|
||||
break;
|
||||
}
|
||||
|
||||
return animation;
|
|
@ -1,22 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates an axis in the 2D space
|
||||
/// </summary>
|
||||
public enum Axis
|
||||
{
|
||||
/// <summary>
|
||||
/// The X axis (horizontal)
|
||||
/// </summary>
|
||||
X,
|
||||
|
||||
/// <summary>
|
||||
/// The Y axis (vertical)
|
||||
/// </summary>
|
||||
Y
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче