Merge branch 'master' into wrapPanelCollapsedItems
This commit is contained in:
Коммит
2e2ed3f22f
|
@ -11,7 +11,7 @@
|
|||
- Guard: Helper methods to verify conditions when running code.
|
||||
- ThrowHelper: Helper methods to efficiently throw exceptions.
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows IncrementalLoadingCollection String Array extensions helpers</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Incremental;Loading;Collection;IncrementalLoadingCollection;String;Array;extensions;helpers</PackageTags>
|
||||
</PropertyGroup>
|
||||
<Choose>
|
||||
<When Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
- Ref<T>: a stack-only struct that can store a reference to a value of a specified type.
|
||||
- NullableRef<T>: a stack-only struct similar to Ref<T>, which also supports nullable references.
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows core standard unsafe span memory string array stream buffer extensions helpers parallel performance</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;core;standard;unsafe;span;memory;string;array;stream;buffer;extensions;helpers;parallel;performance</PackageTags>
|
||||
</PropertyGroup>
|
||||
<Choose>
|
||||
<When Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
- StrongReferenceMessenger: a high-performance messaging system that trades weak references for speed.
|
||||
- Ioc: a helper class to configure dependency injection service containers.
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows MVVM MVVMToolkit observable Ioc dependency injection services extensions helpers</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;WinUI;WPF;Xamarin;Forms;Uno;Platform;MVVM;Toolkit;MVVMToolkit;INotifyPropertyChanged;observable;Ioc;dependency injection;services;extensions;helpers</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- .NET Standard 2.0 doesn't have the Span<T> and IAsyncEnumerable<T> types -->
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
|
||||
<Title>Windows Community Toolkit Devices</Title>
|
||||
<Description>This library enables easier consumption of connectivity Devices/Peripherals and handle its connection to Windows devices. It contains BluetoothLE and Network connectivity helpers.</Description>
|
||||
<PackageTags>UWP Toolkit Windows Devices Bluetooth BluetoothLE BLE Networking</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Devices;Bluetooth;LE;BluetoothLE;BLE;Networking</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
-FocusTrackerControl : The FocusTracker Control is a feature that can be used to display information about the current focused XAML element.
|
||||
-Themes : Provides the source path of the resource dictionaries for the FocusTracker.
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows Controls XAML Developer Tools Accessibility AlignmentGrid</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Controls;XAML;Developer;Tools;Accessibility;Alignment;Grid;AlignmentGrid</PackageTags>
|
||||
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
|
||||
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<TargetFramework>uap10.0.17134</TargetFramework>
|
||||
<Title>Windows Community Toolkit Eye Gaze Library</Title>
|
||||
<Description>A library to integrate gaze interactions using eye trackers into UWP applications</Description>
|
||||
<PackageTags>UWP Toolkit Windows Eye Gaze EyeTracker</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Gaze;Eye;Tracker;EyeTracker</PackageTags>
|
||||
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
|
||||
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -143,10 +143,10 @@ namespace Microsoft.Toolkit.Uwp.Notifications
|
|||
// For apps that don't have identity...
|
||||
if (!DesktopBridgeHelpers.HasIdentity())
|
||||
{
|
||||
// If tag is specified
|
||||
if (!string.IsNullOrEmpty(notification.Tag))
|
||||
// If tag is specified and group isn't specified
|
||||
if (!string.IsNullOrEmpty(notification.Tag) && string.IsNullOrEmpty(notification.Group))
|
||||
{
|
||||
// If group isn't specified, we have to add a group since otherwise can't remove without a group
|
||||
// We have to add a group since otherwise can't remove without a group
|
||||
notification.Group = ToastNotificationManagerCompat.DEFAULT_GROUP;
|
||||
}
|
||||
}
|
||||
|
@ -157,10 +157,10 @@ namespace Microsoft.Toolkit.Uwp.Notifications
|
|||
// For apps that don't have identity...
|
||||
if (!DesktopBridgeHelpers.HasIdentity())
|
||||
{
|
||||
// If tag is specified
|
||||
if (!string.IsNullOrEmpty(notification.Tag))
|
||||
// If tag is specified and group isn't specified
|
||||
if (!string.IsNullOrEmpty(notification.Tag) && string.IsNullOrEmpty(notification.Group))
|
||||
{
|
||||
// If group isn't specified, we have to add a group since otherwise can't remove without a group
|
||||
// We have to add a group since otherwise can't remove without a group
|
||||
notification.Group = ToastNotificationManagerCompat.DEFAULT_GROUP;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Windows.Foundation.Collections;
|
||||
using System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Hosting;
|
||||
|
||||
|
@ -130,30 +130,30 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
|
||||
private static void OnShowAnimationsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
static void OnAnimationsChanged(IObservableVector<DependencyObject> sender, IVectorChangedEventArgs args)
|
||||
static void OnAnimationsChanged(object sender, EventArgs e)
|
||||
{
|
||||
var collection = (ImplicitAnimationSet)sender;
|
||||
|
||||
if (collection.ParentReference!.TryGetTarget(out UIElement element))
|
||||
{
|
||||
ElementCompositionPreview.SetImplicitShowAnimation(element, collection.GetCompositionAnimationGroup());
|
||||
ElementCompositionPreview.SetImplicitShowAnimation(element, collection.GetCompositionAnimationGroup(element));
|
||||
}
|
||||
}
|
||||
|
||||
if (e.OldValue is ImplicitAnimationSet oldCollection)
|
||||
{
|
||||
oldCollection.VectorChanged -= OnAnimationsChanged;
|
||||
oldCollection.AnimationsChanged -= OnAnimationsChanged;
|
||||
}
|
||||
|
||||
if (d is UIElement element &&
|
||||
e.NewValue is ImplicitAnimationSet collection)
|
||||
{
|
||||
collection.ParentReference = new(element);
|
||||
collection.VectorChanged -= OnAnimationsChanged;
|
||||
collection.VectorChanged += OnAnimationsChanged;
|
||||
collection.AnimationsChanged -= OnAnimationsChanged;
|
||||
collection.AnimationsChanged += OnAnimationsChanged;
|
||||
|
||||
ElementCompositionPreview.SetIsTranslationEnabled(element, true);
|
||||
ElementCompositionPreview.SetImplicitShowAnimation(element, collection.GetCompositionAnimationGroup());
|
||||
ElementCompositionPreview.SetImplicitShowAnimation(element, collection.GetCompositionAnimationGroup(element));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,30 +164,30 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
|
||||
private static void OnHideAnimationsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
static void OnAnimationsChanged(IObservableVector<DependencyObject> sender, IVectorChangedEventArgs args)
|
||||
static void OnAnimationsChanged(object sender, EventArgs e)
|
||||
{
|
||||
var collection = (ImplicitAnimationSet)sender;
|
||||
|
||||
if (collection.ParentReference!.TryGetTarget(out UIElement element))
|
||||
{
|
||||
ElementCompositionPreview.SetImplicitHideAnimation(element, collection.GetCompositionAnimationGroup());
|
||||
ElementCompositionPreview.SetImplicitHideAnimation(element, collection.GetCompositionAnimationGroup(element));
|
||||
}
|
||||
}
|
||||
|
||||
if (e.OldValue is ImplicitAnimationSet oldCollection)
|
||||
{
|
||||
oldCollection.VectorChanged -= OnAnimationsChanged;
|
||||
oldCollection.AnimationsChanged -= OnAnimationsChanged;
|
||||
}
|
||||
|
||||
if (d is UIElement element &&
|
||||
e.NewValue is ImplicitAnimationSet collection)
|
||||
{
|
||||
collection.ParentReference = new(element);
|
||||
collection.VectorChanged -= OnAnimationsChanged;
|
||||
collection.VectorChanged += OnAnimationsChanged;
|
||||
collection.AnimationsChanged -= OnAnimationsChanged;
|
||||
collection.AnimationsChanged += OnAnimationsChanged;
|
||||
|
||||
ElementCompositionPreview.SetIsTranslationEnabled(element, true);
|
||||
ElementCompositionPreview.SetImplicitHideAnimation(element, collection.GetCompositionAnimationGroup());
|
||||
ElementCompositionPreview.SetImplicitHideAnimation(element, collection.GetCompositionAnimationGroup(element));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198,30 +198,30 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance for the current event.</param>
|
||||
private static void OnAnimationsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
static void OnAnimationsChanged(IObservableVector<DependencyObject> sender, IVectorChangedEventArgs args)
|
||||
static void OnAnimationsChanged(object sender, EventArgs e)
|
||||
{
|
||||
var collection = (ImplicitAnimationSet)sender;
|
||||
|
||||
if (collection.ParentReference!.TryGetTarget(out UIElement element))
|
||||
{
|
||||
ElementCompositionPreview.GetElementVisual(element).ImplicitAnimations = collection.GetImplicitAnimationCollection();
|
||||
ElementCompositionPreview.GetElementVisual(element).ImplicitAnimations = collection.GetImplicitAnimationCollection(element);
|
||||
}
|
||||
}
|
||||
|
||||
if (e.OldValue is ImplicitAnimationSet oldCollection)
|
||||
{
|
||||
oldCollection.VectorChanged -= OnAnimationsChanged;
|
||||
oldCollection.AnimationsChanged -= OnAnimationsChanged;
|
||||
}
|
||||
|
||||
if (d is UIElement element &&
|
||||
e.NewValue is ImplicitAnimationSet collection)
|
||||
{
|
||||
collection.ParentReference = new(element);
|
||||
collection.VectorChanged -= OnAnimationsChanged;
|
||||
collection.VectorChanged += OnAnimationsChanged;
|
||||
collection.AnimationsChanged -= OnAnimationsChanged;
|
||||
collection.AnimationsChanged += OnAnimationsChanged;
|
||||
|
||||
ElementCompositionPreview.SetIsTranslationEnabled(element, true);
|
||||
ElementCompositionPreview.GetElementVisual(element).ImplicitAnimations = collection.GetImplicitAnimationCollection();
|
||||
ElementCompositionPreview.GetElementVisual(element).ImplicitAnimations = collection.GetImplicitAnimationCollection(element);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
- Expressions: ExpressionNodes, ExpressionValues, ReferenceNodes, CompositionExtensions, ExpressionFunctions, OperationType
|
||||
- AnimationExtensions: Blur, Fade, Light, Offset, Rotate, Saturation, Scale
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows Animations Composition Connected Implicit XAML</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Animations;Composition;Connected;Implicit;XAML</PackageTags>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -91,14 +91,14 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
/// </summary>
|
||||
public RepeatOption Repeat
|
||||
{
|
||||
get => (RepeatOption)GetValue(RepeatOptionProperty);
|
||||
set => SetValue(RepeatOptionProperty, value);
|
||||
get => (RepeatOption)GetValue(RepeatProperty);
|
||||
set => SetValue(RepeatProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identifies the <seealso cref="Repeat"/> dependency property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty RepeatOptionProperty = DependencyProperty.Register(
|
||||
public static readonly DependencyProperty RepeatProperty = DependencyProperty.Register(
|
||||
nameof(Repeat),
|
||||
typeof(RepeatOption),
|
||||
typeof(Animation),
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using Windows.UI.Composition;
|
||||
using Windows.UI.Xaml;
|
||||
using static Microsoft.Toolkit.Uwp.UI.Animations.AnimationExtensions;
|
||||
|
@ -17,6 +18,25 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
public abstract class ImplicitAnimation<TValue, TKeyFrame> : Animation<TValue, TKeyFrame>, IImplicitTimeline
|
||||
where TKeyFrame : unmanaged
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public event EventHandler? AnimationPropertyChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ImplicitAnimation{TValue, TKeyFrame}"/> class.
|
||||
/// </summary>
|
||||
protected ImplicitAnimation()
|
||||
{
|
||||
RegisterPropertyChangedCallback(DelayProperty, RaiseAnimationPropertyChanged);
|
||||
RegisterPropertyChangedCallback(DurationProperty, RaiseAnimationPropertyChanged);
|
||||
RegisterPropertyChangedCallback(EasingTypeProperty, RaiseAnimationPropertyChanged);
|
||||
RegisterPropertyChangedCallback(EasingModeProperty, RaiseAnimationPropertyChanged);
|
||||
RegisterPropertyChangedCallback(RepeatProperty, RaiseAnimationPropertyChanged);
|
||||
RegisterPropertyChangedCallback(DelayBehaviorProperty, RaiseAnimationPropertyChanged);
|
||||
RegisterPropertyChangedCallback(ToProperty, RaiseAnimationPropertyChanged);
|
||||
RegisterPropertyChangedCallback(FromProperty, RaiseAnimationPropertyChanged);
|
||||
RegisterPropertyChangedCallback(KeyFramesProperty, RaiseAnimationPropertyChanged);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the optional implicit target for the animation. This can act as a trigger property for the animation.
|
||||
/// </summary>
|
||||
|
@ -67,5 +87,15 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
|
||||
return builder.GetAnimation(element.GetVisual(), out _);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises the <see cref="AnimationPropertyChanged"/> event.
|
||||
/// </summary>
|
||||
/// <param name="sender">The instance raising the event.</param>
|
||||
/// <param name="property">The <see cref="DependencyProperty"/> that was changed.</param>
|
||||
private void RaiseAnimationPropertyChanged(DependencyObject sender, DependencyProperty property)
|
||||
{
|
||||
AnimationPropertyChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using Windows.Foundation.Collections;
|
||||
using Windows.UI.Composition;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Hosting;
|
||||
|
@ -13,11 +14,73 @@ using Windows.UI.Xaml.Hosting;
|
|||
namespace Microsoft.Toolkit.Uwp.UI.Animations
|
||||
{
|
||||
/// <summary>
|
||||
/// A collection of implicit animations that can be grouped together. This type represents a composite animation
|
||||
/// (such as <see cref="Windows.UI.Xaml.Media.Animation.Storyboard"/>) that is executed on a given element.
|
||||
/// A collection of implicit animations that can be assigned to a <see cref="UIElement"/> and configured to be run automatically
|
||||
/// when the element is either shown or hidden (through <see cref="Implicit.ShowAnimationsProperty"/> and <see cref="Implicit.HideAnimationsProperty"/>),
|
||||
/// or whenever one of the targeted properties on the underlying <see cref="Visual"/> element changes (through <see cref="Implicit.AnimationsProperty"/>).
|
||||
/// <para>
|
||||
/// Animations within an <see cref="ImplicitAnimationSet"/> should be objects implementing the <see cref="IImplicitTimeline"/> interface, such as
|
||||
/// types inheriting from <see cref="ImplicitAnimation{TValue, TKeyFrame}"/> (eg. <see cref="OpacityAnimation"/>, <see cref="TranslationAnimation"/>,
|
||||
/// <see cref="OffsetAnimation"/> and <see cref="ScaleAnimation"/>, or custom ones such as <see cref="ScalarAnimation"/> and <see cref="Vector3Animation"/>).
|
||||
/// Adding incompatible elements cannot be validated at build-time, but will result in a runtime crash.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Animations will monitor for changes in real-time to any of their public properties. For instance, if a binding is used to dynamically update the
|
||||
/// <see cref="Animation{TValue, TKeyFrame}.To"/> or <see cref="Animation{TValue, TKeyFrame}.From"/> properties, the entire animation set will be
|
||||
/// initialized again and assigned to the underlying <see cref="Visual"/> object for the targeted <see cref="UIElement"/>. This does not currently apply
|
||||
/// to changes to the <see cref="Animation{TValue, TKeyFrame}.KeyFrames"/> property though (other than the entire property being reassigned). To achieve
|
||||
/// dynamic updates to animation sets in that case, either leverage expression keyframes or just use code-behind to manually reinitialize the animations.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// An <see cref="ImplicitAnimationSet"/> instance can only be used on a single <see cref="UIElement"/> target, and it cannot be shared across multiple
|
||||
/// elements. Attempting to do so will result in a runtime crash. Furthermore, it is recommended not to move <see cref="IImplicitTimeline"/> instances from
|
||||
/// one <see cref="ImplicitAnimationSet"/> to another, and doing so will add unnecessary runtime overhead over time. If you want to apply the same animations
|
||||
/// to multiple elements, simply create another <see cref="ImplicitAnimationSet"/> instance and another set of animations with the same properties within it.
|
||||
/// </remarks>
|
||||
public sealed class ImplicitAnimationSet : DependencyObjectCollection
|
||||
{
|
||||
/// <summary>
|
||||
/// Raised whenever any configuration change occurrs within the current <see cref="ImplicitAnimationSet"/> instance.
|
||||
/// </summary>
|
||||
internal event EventHandler? AnimationsChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ImplicitAnimationSet"/> class.
|
||||
/// </summary>
|
||||
public ImplicitAnimationSet()
|
||||
{
|
||||
VectorChanged += ImplicitAnimationSetVectorChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers <see cref="RaiseAnimationsChanged(object, EventArgs)"/> for every added animation.
|
||||
/// </summary>
|
||||
/// <param name="sender">The current vector of animations.</param>
|
||||
/// <param name="event">The <see cref="IVectorChangedEventArgs"/> instance for the current event.</param>
|
||||
private void ImplicitAnimationSetVectorChanged(IObservableVector<DependencyObject> sender, IVectorChangedEventArgs @event)
|
||||
{
|
||||
if (@event.CollectionChange == CollectionChange.ItemInserted ||
|
||||
@event.CollectionChange == CollectionChange.ItemChanged)
|
||||
{
|
||||
IImplicitTimeline item = (IImplicitTimeline)sender[(int)@event.Index];
|
||||
|
||||
item.AnimationPropertyChanged -= RaiseAnimationsChanged;
|
||||
item.AnimationPropertyChanged += RaiseAnimationsChanged;
|
||||
}
|
||||
|
||||
AnimationsChanged?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raises the <see cref="AnimationsChanged"/> event.
|
||||
/// </summary>
|
||||
/// <param name="sender">The instance raising the event.</param>
|
||||
/// <param name="e">The empty <see cref="EventArgs"/> for the event.</param>
|
||||
private void RaiseAnimationsChanged(object sender, EventArgs e)
|
||||
{
|
||||
AnimationsChanged?.Invoke(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the weak reference to the parent that owns the current implicit animation collection.
|
||||
/// </summary>
|
||||
|
@ -27,11 +90,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
/// Creates a <see cref="CompositionAnimationGroup"/> for the current collection.
|
||||
/// This can be used to be assigned to show/hide implicit composition animations.
|
||||
/// </summary>
|
||||
/// <param name="parent">The target <see cref="UIElement"/> to which the animations are being applied to.</param>
|
||||
/// <returns>The <see cref="CompositionAnimationGroup"/> instance to use.</returns>
|
||||
[Pure]
|
||||
internal CompositionAnimationGroup GetCompositionAnimationGroup()
|
||||
internal CompositionAnimationGroup GetCompositionAnimationGroup(UIElement parent)
|
||||
{
|
||||
UIElement parent = GetParent();
|
||||
Compositor compositor = ElementCompositionPreview.GetElementVisual(parent).Compositor;
|
||||
CompositionAnimationGroup animations = compositor.CreateAnimationGroup();
|
||||
|
||||
|
@ -47,11 +110,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
/// Creates an <see cref="ImplicitAnimationCollection"/> for the current collection.
|
||||
/// This can be used to be assigned to implicit composition animations.
|
||||
/// </summary>
|
||||
/// <param name="parent">The target <see cref="UIElement"/> to which the animations are being applied to.</param>
|
||||
/// <returns>The <see cref="ImplicitAnimationCollection"/> instance to use.</returns>
|
||||
[Pure]
|
||||
internal ImplicitAnimationCollection GetImplicitAnimationCollection()
|
||||
internal ImplicitAnimationCollection GetImplicitAnimationCollection(UIElement parent)
|
||||
{
|
||||
UIElement parent = GetParent();
|
||||
Compositor compositor = ElementCompositionPreview.GetElementVisual(parent).Compositor;
|
||||
ImplicitAnimationCollection animations = compositor.CreateImplicitAnimationCollection();
|
||||
|
||||
|
@ -71,25 +134,5 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
|
||||
return animations;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current parent <see cref="UIElement"/> instance.
|
||||
/// </summary>
|
||||
/// <returns>The <see cref="UIElement"/> reference from <see cref="ParentReference"/>.</returns>
|
||||
/// <exception cref="InvalidOperationException">Thrown if there is no parent available.</exception>
|
||||
[Pure]
|
||||
private UIElement GetParent()
|
||||
{
|
||||
UIElement? parent = null;
|
||||
|
||||
if (ParentReference?.TryGetTarget(out parent) != true)
|
||||
{
|
||||
ThrowInvalidOperationException();
|
||||
}
|
||||
|
||||
return parent!;
|
||||
|
||||
static void ThrowInvalidOperationException() => throw new InvalidOperationException("The current ImplicitAnimationSet object isn't bound to a parent UIElement instance.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// 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 Windows.UI.Composition;
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
|
@ -14,6 +15,13 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
|
|||
/// </summary>
|
||||
public interface IImplicitTimeline
|
||||
{
|
||||
/// <summary>
|
||||
/// Raised whenever a property that influences the animation changes.
|
||||
/// This event is used by <see cref="ImplicitAnimationSet"/> to update the animations collection
|
||||
/// assigned to a target <see cref="UIElement"/> when any of the individual animations is modified.
|
||||
/// </summary>
|
||||
event EventHandler? AnimationPropertyChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="CompositionAnimation"/> from the current node. This animation might
|
||||
/// be used either as an implicit show/hide animation, or as a direct implicit animation.
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
- ViewportBehavior: Listening for element to enter or exit the ScrollViewer viewport
|
||||
- FadeHeaderBehavior, QuickReturnHeaderBehavior, StickyHeaderBehavior: Helpers for ListViewBase Header Behavior
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows UI Behaviors XAML</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;UI;Behaviors;Interactivity;Interaction;XAML</PackageTags>
|
||||
|
||||
<UseWindowsDesktopSdk>true</UseWindowsDesktopSdk>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -14,10 +14,24 @@
|
|||
- Loading: Helps to show content with animation to the user while the app is doing some calculation.
|
||||
- RadialProgressBar: Displays progress as a circle getting filled.
|
||||
- RotatorTile: Rotates through a set of items one-by-one like a live-tile.
|
||||
- TabbedCommandBar: A command bar that organizes features of an application into a series of tabs.
|
||||
- TextToolbar: A Toolbar for Editing Text attached to a RichEditBox. It can format RTF, Markdown, or use a Custom Formatter.
|
||||
- TileControl: A ContentControl that show an image repeated many times.
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows Controls XAML Markdown CameraPreview Camera DropShadow ImageEx InAppNotification InfiniteCanvas Radial RadialProgressBar Scroll ScrollHeader Tile</PackageTags>
|
||||
<PackageTags>
|
||||
Windows;Community;Toolkit;WCT;UWP;Controls;XAML;
|
||||
Camera;Preview ;CameraPreview ;
|
||||
Drop;Shadow;Panel ;DropShadowPanel ;DropShadow ;
|
||||
Image;Ex ;ImageEx ;
|
||||
In;App;Notification;InAppNotification;InApp ;
|
||||
Loading ;
|
||||
Menu ;
|
||||
Radial;Progress;Bar;RadialProgressBar;ProgressBar ;
|
||||
Rotator;Tile ;RotatorTile ;
|
||||
Tabbed;Command;Bar ;TabbedCommandBar ;CommandBar ;
|
||||
Text;Tool;Bar ;TextToolBar ;ToolBar ;Markdown;
|
||||
Tile;Control ;TileControl ;
|
||||
</PackageTags>
|
||||
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
|
||||
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
|
||||
<LangVersion>9.0</LangVersion>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
This library provides a XAML DataGrid control. It is part of the Windows Community Toolkit.
|
||||
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows Controls XAML DataGrid</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Controls;XAML;Data;Grid;DataGrid</PackageTags>
|
||||
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls</RootNamespace>
|
||||
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
|
||||
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
|
||||
|
|
|
@ -13,7 +13,14 @@
|
|||
- RemoteDevicePicker: Remote Device Picker Control for Project Rome.
|
||||
- TokenizingTextBox: An AutoSuggestBox like control which places entered input into easily removed containers for contacts or tags.
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows Controls XAML Range Radial Gauge RadiaGauge Tokenizing TextBox</PackageTags>
|
||||
<PackageTags>
|
||||
Windows;Community;Toolkit;WCT;UWP;Controls;XAML;
|
||||
Color;Picker;Button ;ColorPickerButton ;ColorPicker ;
|
||||
Radial;Gauge ;RadialGauge ;
|
||||
Range;Selector ;RangeSelector ;
|
||||
Remote;Device;Picker;RemoteDevicePicker;DevicePicker;RemoteDevice;
|
||||
Tokenizing;Text;Box ;TokenizingTextBox ;TextBox ;
|
||||
</PackageTags>
|
||||
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
|
||||
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
|
|
|
@ -17,7 +17,18 @@
|
|||
- ListDetailsView: Implements the List/Details design pattern.
|
||||
- OrbitView: Positions items in a circle around a center element and supports orbits and anchors.
|
||||
</Description>
|
||||
<PackageTags>BladeView Blade Carousel Expander GridSplitter HeaderedContent List Details ListDetails Orbit</PackageTags>
|
||||
<PackageTags>
|
||||
Windows;Community;Toolkit;WCT;
|
||||
Blade;View ;BladeView ;
|
||||
Carousel ;
|
||||
Expander ;
|
||||
Grid;Splitter ;GridSplitter ;
|
||||
Headered;Content;Control;HeaderedContentControl;ContentControl ;HeaderedContent;
|
||||
Headered;Items;Control ;HeaderedItemsControl ;ItemsControl ;HeaderedItems ;
|
||||
Layout;Transform;Control;LayoutTransformControl;LayoutTransform;
|
||||
List;Details;View ;ListDetailsView ;ListDetails ;
|
||||
Orbit;View ;OrbitView ;
|
||||
</PackageTags>
|
||||
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls</RootNamespace>
|
||||
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
This library provides a XAML MarkdownTextBlock control, an efficient and extensible control that can parse and render markdown. It is part of the Windows Community Toolkit.
|
||||
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows Controls XAML Markdown MarkdownTextBlock</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Controls;XAML;Markdown;Text;Block;MarkdownTextBlock</PackageTags>
|
||||
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls</RootNamespace>
|
||||
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
|
||||
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
|
||||
|
|
|
@ -11,7 +11,12 @@
|
|||
- ImageCropper: ImageCropper control allows user to crop image freely.
|
||||
- InfiniteCanvas: Supports Infinite Scrolling, Ink, Text, Format Text, Zoom in/out, Redo, Undo, Export & Import.
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows Controls XAML InfiniteCanvas Eyedropper</PackageTags>
|
||||
<PackageTags>
|
||||
Windows;Community;Toolkit;WCT;UWP;Controls;XAML;
|
||||
Eye;Dropper ;EyeDropper ;
|
||||
Image;Cropper ;ImageCropper ;Crop;
|
||||
Infinite;Canvas;InfiniteCanvas;
|
||||
</PackageTags>
|
||||
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
|
||||
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
|
|
|
@ -9,12 +9,24 @@
|
|||
Controls:
|
||||
- AdaptiveGridView: Presents items in an evenly-spaced set of columns to fill the total available space.
|
||||
- DockPanel: Define areas where you can arrange child elements either horizontally or vertically, relative to each other.
|
||||
- StaggeredLayout: Layout of items in a column approach where an item will be added to whichever column has used the least amount of space.
|
||||
- StaggeredPanel: Layout of items in a column approach where an item will be added to whichever column has used the least amount of space.
|
||||
- SwitchPresenter: A presenter which can act as a switch statement for layout providing alternate layouts based on a value.
|
||||
- UniformGrid: Presents items in an evenly-spaced set of rows or columns to fill the total available display space.
|
||||
- WrapLayout: Positions child elements in sequential position from left to right and breaks content to the next line.
|
||||
- WrapPanel: Positions child elements in sequential position from left to right and breaks content to the next line.
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows Controls XAML WrapPanel Adaptive DockPanel StaggeredPanel Staggered SwitchPresenter UniformGrid Uniform Grid</PackageTags>
|
||||
<PackageTags>
|
||||
Windows;Community;Toolkit;WCT;UWP;Controls;XAML;
|
||||
Adaptive;Grid;View;AdaptiveGridView;GridView ;AdaptiveGrid ;
|
||||
Dock;Panel ;DockPanel ;
|
||||
Staggered;Layout ;StaggeredLayout ;
|
||||
Staggered;Panel ;StaggeredPanel ;
|
||||
Switch;Presenter ;SwitchPresenter ;
|
||||
Uniform;Grid ;UniformGrid ;
|
||||
Wrap;Layout ;WrapLayout ;
|
||||
Wrap;Panel ;WrapPanel ;
|
||||
</PackageTags>
|
||||
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
|
||||
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
Geometry:
|
||||
- CanvasPathGeometry: A class that parses Win2d Path Mini Language and converts it to CanvasGeometry, CanvasBrush, CanvasStroke, CanvasStrokeStyle or Color.
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows UI XAML brushes blur</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;UI;XAML;brushes;blur;effects;animations</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
- DependencyPropertyWatcher: Used to Track Changes of a Dependency Property
|
||||
- ThemeListener: Class which listens for changes to Application Theme or High Contrast Modes and Signals an Event when they occur.
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows UI Converters XAML extensions helpers</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;UI;Converters;XAML;extensions;helpers</PackageTags>
|
||||
<UseWindowsDesktopSdk>true</UseWindowsDesktopSdk>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
|
||||
<Title>Windows Community Toolkit</Title>
|
||||
<Description>This package includes code only helpers such as Colors conversion tool, Storage file handling, a Stream helper class, etc.</Description>
|
||||
<PackageTags>UWP Toolkit Windows</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP</PackageTags>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
- IncrementalLoadingCollection: Simplifies the definition and usage of collections whose items can be loaded incrementally only when needed by the view.
|
||||
- String extensions and array extensions: These extensions make working with string and arrays easier.
|
||||
</Description>
|
||||
<PackageTags>UWP Toolkit Windows IncrementalLoadingCollection String Array extensions helpers</PackageTags>
|
||||
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Incremental;Loading;Collection;IncrementalLoadingCollection;String;Array;extensions;helpers</PackageTags>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- .NET Standard 1.4 doesn't have the [Pure] attribute -->
|
||||
|
|
Загрузка…
Ссылка в новой задаче