Merge branch 'master' into add-textbox-selectall-behavior

This commit is contained in:
Julien Brianceau 2021-03-12 09:45:21 +01:00 коммит произвёл GitHub
Родитель 96ccfe1871 a2ed6aa69d
Коммит 8ac9c11b28
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
151 изменённых файлов: 3528 добавлений и 3056 удалений

Просмотреть файл

@ -0,0 +1,55 @@
// 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.
// This extension is restricted to the .NET 5 because it shares the same BCL
// across all targets, ensuring that the layout of our Nullable<T> mapping type
// will be correct. Exposing this API on older targets (especially .NET Standard)
// is not guaranteed to be correct and could result in invalid memory accesses.
#if NET5_0
using System;
using System.Runtime.CompilerServices;
namespace Microsoft.Toolkit.HighPerformance.Extensions
{
/// <summary>
/// Helpers for working with the <see cref="Nullable{T}"/> type.
/// </summary>
public static class NullableExtensions
{
/// <summary>
/// Returns a reference to the value of the input <see cref="Nullable{T}"/> instance, regardless of whether
/// the <see cref="Nullable{T}.HasValue"/> property is returning <see langword="true"/> or not. If that is not
/// the case, this method will still return a reference to the underlying <see langword="default"/> value.
/// </summary>
/// <typeparam name="T">The type of the underlying value</typeparam>
/// <param name="value">The <see cref="Nullable{T}"/></param>
/// <returns>A reference to the underlying value from the input <see cref="Nullable{T}"/> instance.</returns>
/// <remarks>
/// Note that attempting to mutate the returned reference will not change the value returned by <see cref="Nullable{T}.HasValue"/>.
/// That means that reassigning the value of an empty instance will not make <see cref="Nullable{T}.HasValue"/> return <see langword="true"/>.
/// </remarks>
public static ref T DangerousGetValueOrDefaultReference<T>(this ref T? value)
where T : struct
{
return ref Unsafe.As<T?, RawNullableData<T>>(ref value).Value;
}
/// <summary>
/// Mapping type that reflects the internal layout of the <see cref="Nullable{T}"/> type.
/// See https://github.com/dotnet/runtime/blob/master/src/libraries/System.Private.CoreLib/src/System/Nullable.cs.
/// </summary>
/// <typeparam name="T">The value type wrapped by the current instance.</typeparam>
private struct RawNullableData<T>
where T : struct
{
#pragma warning disable CS0649 // Unassigned fields
public bool HasValue;
public T Value;
#pragma warning restore CS0649
}
}
}
#endif

Просмотреть файл

@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Controls;
@ -45,7 +46,7 @@ namespace Microsoft.Toolkit.Uwp.DeveloperTools
}
}
private DispatcherTimer updateTimer;
private DispatcherQueueTimer updateTimer;
private TextBlock controlName;
private TextBlock controlType;
private TextBlock controlAutomationName;
@ -72,7 +73,7 @@ namespace Microsoft.Toolkit.Uwp.DeveloperTools
{
if (updateTimer == null)
{
updateTimer = new DispatcherTimer();
updateTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();
updateTimer.Tick += UpdateTimer_Tick;
}

Просмотреть файл

@ -11,6 +11,7 @@ using System.Threading.Tasks;
using Windows.Devices.Input.Preview;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.System;
using Windows.UI;
using Windows.UI.Core;
using Windows.UI.Xaml;
@ -354,7 +355,7 @@ namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction
_gazeCursor = new GazeCursor();
// timer that gets called back if there gaze samples haven't been received in a while
_eyesOffTimer = new DispatcherTimer();
_eyesOffTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();
_eyesOffTimer.Tick += OnEyesOff;
// provide a default of GAZE_IDLE_TIME microseconds to fire eyes off
@ -860,7 +861,7 @@ namespace Microsoft.Toolkit.Uwp.Input.GazeInteraction
private readonly List<int> _roots = new List<int>();
private readonly DispatcherTimer _eyesOffTimer;
private readonly DispatcherQueueTimer _eyesOffTimer;
private readonly GazeCursor _gazeCursor;

Просмотреть файл

@ -4,25 +4,25 @@
xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
RequiresPointerMode="Auto">
<Application.Resources>
<ResourceDictionary>
<!-- Color Resources -->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Styles/Themes.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/Generic.xaml" />
<Application.Resources>
<ResourceDictionary>
<!-- Color Resources -->
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Styles/Themes.xaml" />
<ResourceDictionary Source="ms-appx:///Styles/Generic.xaml" />
<!-- WinUI -->
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>
</ResourceDictionary.MergedDictionaries>
<!-- WinUI -->
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
</ResourceDictionary.MergedDictionaries>
<!-- Converters -->
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
<!-- Converters -->
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
<converters:EmptyStringToObjectConverter x:Key="EmptyStringToObject"
EmptyValue="Collapsed"
NotEmptyValue="Visible" />
<converters:EmptyStringToObjectConverter x:Key="EmptyStringToObject"
EmptyValue="Collapsed"
NotEmptyValue="Visible" />
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</ResourceDictionary>
</Application.Resources>
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</ResourceDictionary>
</Application.Resources>
</Application>

Просмотреть файл

@ -1,8 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.SampleApp.Controls"
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.Controls">
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.SampleApp.Controls"
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.Controls">
<Style TargetType="controls:CodeRenderer">
<Setter Property="Template">
@ -14,25 +13,24 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid x:Name="Container"
Grid.RowSpan="2"
Opacity="0" />
<ScrollViewer
Grid.Row="0"
HorizontalScrollMode="Auto"
HorizontalScrollBarVisibility="Auto">
Grid.RowSpan="2"
Opacity="0" />
<ScrollViewer Grid.Row="0"
HorizontalScrollBarVisibility="Auto"
HorizontalScrollMode="Auto">
<RichTextBlock Name="codeView"
FontFamily="Consolas"
Padding="10" />
Padding="10"
FontFamily="Consolas" />
</ScrollViewer>
<StackPanel Grid.Row="1"
HorizontalAlignment="Center"
Orientation="Horizontal">
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button x:Name="CopyButton"
Margin="5"
Content="Copy" />
Margin="5"
Content="Copy" />
<Button x:Name="PrintButton"
Margin="5"
Content="Print" />
Margin="5"
Content="Print" />
</StackPanel>
</Grid>
</ControlTemplate>

Просмотреть файл

@ -11,5 +11,10 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.Data
public string Category { get; set; }
public string Thumbnail { get; set; }
public override string ToString()
{
return Title;
}
}
}

Просмотреть файл

@ -272,6 +272,13 @@
<Content Include="Icons\More.png" />
<Content Include="Icons\Notifications.png" />
<Content Include="Icons\Services.png" />
<Content Include="SamplePages\Animations\Effects\EffectAnimations.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SamplePages\Graph\LoginButton.png" />
<Content Include="SamplePages\Graph\PeoplePicker.png" />
<Content Include="SamplePages\Graph\PersonView.png" />
<Content Include="SamplePages\Primitives\SwitchPresenter.png" />
<Content Include="SamplePages\TabbedCommandBar\TabbedCommandBar.png" />
<Content Include="SamplePages\Animations\Effects\FadeBehavior.png" />
<Content Include="SamplePages\ColorPicker\ColorPicker.png" />
@ -492,12 +499,8 @@
<DependentUpon>AutoSelectBehaviorPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\CanvasPathGeometry\GeometryStreamReader.cs" />
<Compile Include="SamplePages\ColorPicker\ColorPickerButtonPage.xaml.cs">
<DependentUpon>ColorPickerButtonPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\ColorPicker\ColorPickerPage.xaml.cs">
<DependentUpon>ColorPickerPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\EnumValuesExtension\Animal.cs" />
<Compile Include="SamplePages\EnumValuesExtension\AnimalToColorConverter.xaml.cs" />
<Compile Include="SamplePages\EnumValuesExtension\EnumValuesExtensionPage.xaml.cs">
<DependentUpon>EnumValuesExtensionPage.xaml</DependentUpon>
</Compile>
@ -617,7 +620,12 @@
<Content Include="SamplePages\Animations\Behaviors\RotateBehaviorXaml.bind" />
<Content Include="SamplePages\Animations\Effects\EffectAnimations.bind" />
<Content Include="SamplePages\VisualEffectFactory\VisualEffectFactory.bind" />
<Content Include="SamplePages\Animations\Activities\InvokeActionsActivityCode.bind" />
<Content Include="SamplePages\Animations\Activities\StartAnimationActivityCode.bind" />
<Content Include="SamplePages\AutoSelectBehavior\AutoSelectBehaviorXaml.bind" />
<Content Include="SamplePages\Graph\LoginButtonXaml.bind" />
<Content Include="SamplePages\Graph\PeoplePickerXaml.bind" />
<Content Include="SamplePages\Graph\PersonViewXaml.bind" />
</ItemGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
@ -899,9 +907,6 @@
<Compile Include="SamplePages\RadialGauge\RadialGaugePage.xaml.cs">
<DependentUpon>RadialGaugePage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\RangeSelector\RangeSelectorPage.xaml.cs">
<DependentUpon>RangeSelectorPage.xaml</DependentUpon>
</Compile>
<Compile Include="SamplePages\WrapPanel\WrapPanelPage.xaml.cs">
<DependentUpon>WrapPanelPage.xaml</DependentUpon>
</Compile>
@ -959,14 +964,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\ColorPicker\ColorPickerButtonPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\ColorPicker\ColorPickerPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\EnumValuesExtension\EnumValuesExtensionPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -982,6 +979,9 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Content Include="SamplePages\Primitives\SwitchPresenter.bind">
<SubType>Designer</SubType>
</Content>
<Page Include="SamplePages\TilesBrush\TilesBrushPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -1349,10 +1349,6 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\RangeSelector\RangeSelectorPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SamplePages\WrapLayout\WrapLayoutPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

Просмотреть файл

@ -21,7 +21,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
[JsonPropertyName("name")]
public string Name { get; set; }
public string FullName => $"Version {Name.Replace("v", string.Empty)} notes";
public string FullName => $"Version {Name.Substring(1)} notes"; // Skip the initial 'v' we put at the front. If we replace all 'v's then we hit 'preview'.
[JsonPropertyName("draft")]
public bool IsDraft { get; set; }

Просмотреть файл

@ -16,6 +16,7 @@ using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
// TODO Reintroduce graph controls
// using Microsoft.Toolkit.Graph.Converters;
// using Microsoft.Toolkit.Graph.Providers;
@ -26,6 +27,7 @@ using Microsoft.Toolkit.Uwp.UI.Animations;
using Microsoft.Toolkit.Uwp.UI.Controls;
using Microsoft.Toolkit.Uwp.UI.Media;
using Microsoft.UI.Xaml;
using Windows.ApplicationModel;
using Windows.Foundation.Metadata;
using Windows.Storage;
using Windows.Storage.Streams;
@ -70,7 +72,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
}
private string _cachedDocumentation = string.Empty;
private string _cachedPath = string.Empty;
internal static async Task<Sample> FindAsync(string category, string name)
{
@ -117,7 +118,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
#if DEBUG
_codeUrl = value;
#else
var regex = new Regex("^https://github.com/Microsoft/WindowsCommunityToolkit/(tree|blob)/(?<branch>.+?)/(?<path>.*)");
var regex = new Regex("^https://github.com/windows-toolkit/WindowsCommunityToolkit/(tree|blob)/(?<branch>.+?)/(?<path>.*)");
var docMatch = regex.Match(value);
var branch = string.Empty;
@ -134,7 +135,8 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
}
else
{
_codeUrl = $"https://github.com/Microsoft/WindowsCommunityToolkit/tree/master/{path}";
var packageVersion = Package.Current.Id.Version.ToFormattedString(3);
_codeUrl = $"https://github.com/Microsoft/WindowsCommunityToolkit/tree/rel/{packageVersion}/{path}";
}
#endif
}
@ -148,8 +150,21 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
public string XamlCode { get; private set; }
/// <summary>
/// Gets or sets the path set in the samples.json pointing to the doc for the sample.
/// </summary>
public string DocumentationUrl { get; set; }
/// <summary>
/// Gets or sets the absolute local doc path for cached file in app.
/// </summary>
public string LocalDocumentationFilePath { get; set; }
/// <summary>
/// Gets or sets the base path segment to the current document location.
/// </summary>
public string RemoteDocumentationPath { get; set; }
public string Icon { get; set; }
public string BadgeUpdateVersionRequired { get; set; }
@ -190,32 +205,29 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
}
}
#pragma warning disable SA1009 // Doesn't like ValueTuples.
public async Task<(string contents, string path)> GetDocumentationAsync()
#pragma warning restore SA1009 // Doesn't like ValueTuples.
public async Task<string> GetDocumentationAsync()
{
if (!string.IsNullOrWhiteSpace(_cachedDocumentation))
{
return (_cachedDocumentation, _cachedPath);
return _cachedDocumentation;
}
var filepath = string.Empty;
var filename = string.Empty;
var localPath = string.Empty;
LocalDocumentationFilePath = string.Empty;
var docRegex = new Regex("^" + _docsOnlineRoot + "(?<branch>.+?)/docs/(?<file>.+)");
var docMatch = docRegex.Match(DocumentationUrl);
if (docMatch.Success)
{
filepath = docMatch.Groups["file"].Value;
filename = Path.GetFileName(filepath);
localPath = $"ms-appx:///docs/{Path.GetDirectoryName(filepath)}/";
filename = Path.GetFileName(RemoteDocumentationPath);
RemoteDocumentationPath = Path.GetDirectoryName(filepath);
LocalDocumentationFilePath = $"ms-appx:///docs/{RemoteDocumentationPath}/";
}
#if !DEBUG // use the docs repo in release mode
string modifiedDocumentationUrl = $"{_docsOnlineRoot}master/docs/{filepath}";
_cachedPath = modifiedDocumentationUrl.Replace(filename, string.Empty);
string modifiedDocumentationUrl = $"{_docsOnlineRoot}live/docs/{filepath}";
// Read from Cache if available.
try
@ -263,7 +275,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
{
var result = await localDocsStream.ReadTextAsync(Encoding.UTF8);
_cachedDocumentation = ProcessDocs(result);
_cachedPath = localPath;
}
}
catch (Exception)
@ -271,7 +282,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
}
}
return (_cachedDocumentation, _cachedPath);
return _cachedDocumentation;
}
/// <summary>
@ -648,6 +659,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
GridSplitter.GridResizeDirection.Auto.GetType(), // Microsoft.Toolkit.Uwp.UI.Controls.Layout
typeof(MarkdownTextBlock), // Microsoft.Toolkit.Uwp.UI.Controls.Markdown
BitmapFileFormat.Bmp.GetType(), // Microsoft.Toolkit.Uwp.UI.Controls.Media
typeof(AlphaMode), // Microsoft.Toolkit.Uwp.UI.Media
StretchChild.Last.GetType() // Microsoft.Toolkit.Uwp.UI.Controls.Primitivs
};
@ -659,7 +671,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
{
try
{
var branchEndpoint = "https://api.github.com/repos/microsoftdocs/uwpcommunitytoolkitdocs/git/refs/heads/live";
var branchEndpoint = "https://api.github.com/repos/microsoftdocs/windowscommunitytoolkitdocs/git/refs/heads/live";
var request = new HttpRequestMessage(HttpMethod.Get, branchEndpoint);
request.Headers.Add("User-Agent", "Windows Community Toolkit Sample App");

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" IgnorableNamespaces="uap mp uap3">
<Identity Name="52b9212c-97a9-4639-9426-3e1ea9c1569e" Publisher="CN=Nikola" Version="6.1.0.0" />
<Identity Name="52b9212c-97a9-4639-9426-3e1ea9c1569e" Publisher="CN=Nikola" Version="7.0.0.0" />
<mp:PhoneIdentity PhoneProductId="52b9212c-97a9-4639-9426-3e1ea9c1569e" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>Microsoft.Toolkit.Uwp.SampleApp</DisplayName>

Просмотреть файл

@ -4,10 +4,10 @@
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sampleapp="using:Microsoft.Toolkit.Uwp.SampleApp"
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
Loaded="Page_Loaded"
mc:Ignorable="d">
@ -150,7 +150,7 @@
<TextBlock Margin="0,20,0,0"
FontSize="14"
Foreground="{ThemeResource Brush-Link-Normal}"
Text="The Windows Community Toolkit is a collection of helper functions, custom controls, and app services. It simplifies and demonstrates common developer patterns when building experiences for Windows 10."
Text="The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks for building UWP and .NET apps for Windows 10."
TextWrapping="Wrap" />
</StackPanel>
@ -158,7 +158,7 @@
Grid.Column="1"
animations:Implicit.Animations="{StaticResource ImplicitOffset}">
<StackPanel>
<TextBlock Style="{StaticResource AboutPageHeader}">Recent Activity</TextBlock>
<TextBlock Style="{StaticResource AboutPageHeader}" Text="Recent Activity"/>
<Grid Margin="0,16,0,0">
<TextBlock FontFamily="Segoe UI"
@ -195,7 +195,7 @@
<StackPanel x:Name="ReleaseNotesPanel"
animations:Implicit.Animations="{StaticResource ImplicitOffset}">
<TextBlock Style="{StaticResource AboutPageHeader}">Release Notes</TextBlock>
<TextBlock Style="{StaticResource AboutPageHeader}" Text="Release Notes"/>
<ItemsControl Margin="0,16,0,0"
ItemTemplate="{StaticResource ReleaseNoteTemplate}"
ItemsSource="{x:Bind GitHubReleases, Mode=OneWay}" />
@ -254,7 +254,7 @@
animations:Implicit.Animations="{StaticResource ImplicitOffset}"
NavigateUri="https://go.microsoft.com/fwlink/?LinkId=521839"
Style="{StaticResource AboutHyperlinkButtonStyle}">
<TextBlock>Privacy statement</TextBlock>
<TextBlock Text="Privacy statement"/>
</HyperlinkButton>
</Grid>
</ScrollViewer>

Просмотреть файл

@ -273,10 +273,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
if (CurrentSample.HasDocumentation)
{
#pragma warning disable SA1008 // Opening parenthesis must be spaced correctly
var (contents, path) = await CurrentSample.GetDocumentationAsync();
#pragma warning restore SA1008 // Opening parenthesis must be spaced correctly
documentationPath = path;
var contents = await CurrentSample.GetDocumentationAsync();
if (!string.IsNullOrWhiteSpace(contents))
{
DocumentationTextBlock.Text = contents;
@ -431,9 +428,15 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
{
TrackingManager.TrackEvent("Link", e.Link);
var link = e.Link;
if (e.Link.EndsWith(".md"))
if (link.EndsWith(".md"))
{
link = string.Format("https://docs.microsoft.com/en-us/windows/communitytoolkit/{0}/{1}", CurrentSample.CategoryName.ToLower(), link.Replace(".md", string.Empty));
// Link to one of our other documents, so we'll construct the proper link here
link = string.Format("https://docs.microsoft.com/windows/communitytoolkit/{0}/{1}", CurrentSample.RemoteDocumentationPath, link.Replace(".md", string.Empty));
}
else if (link.StartsWith("/"))
{
// We don't root our links to other docs.microsoft.com pages anymore, so we'll add it here.
link = string.Format("https://docs.microsoft.com{0}", link);
}
if (Uri.TryCreate(link, UriKind.Absolute, out Uri result))
@ -450,7 +453,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
// Determine if the link is not absolute, meaning it is relative.
if (!Uri.TryCreate(e.Url, UriKind.Absolute, out Uri url))
{
url = new Uri(documentationPath + e.Url);
url = new Uri(CurrentSample.LocalDocumentationFilePath + e.Url);
}
if (url.Scheme == "ms-appx")
@ -698,7 +701,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
private PaneState _paneState;
private bool _onlyDocumentation;
private string documentationPath;
private ThemeListener _themeListener;

Просмотреть файл

@ -0,0 +1,15 @@
using Microsoft.Toolkit.Uwp.UI.Animations;
// Fade out the TextBlock
await AnimationBuilder
.Create()
.Opacity(from: 1, to: 0, duration: TimeSpan.FromSeconds(1), easingType: EasingType.Linear)
.StartAsync(MyText);
// Change the text and the sound here...
// Fade the TextBlock back in
await AnimationBuilder
.Create()
.Opacity(to: 1, duration: TimeSpan.FromSeconds(1), easingType: EasingType.Linear)
.StartAsync(MyText);

Просмотреть файл

@ -0,0 +1,40 @@
using Microsoft.Toolkit.Uwp.UI.Animations;
// Move the button down and then back up
AnimationBuilder
.Create()
.Translation(Axis.Y).TimedKeyFrames(b => b
.KeyFrame(TimeSpan.Zero, 0)
.KeyFrame(TimeSpan.FromSeconds(3), 32, EasingType.Linear)
.KeyFrame(TimeSpan.FromSeconds(9), 32, EasingType.Linear)
.KeyFrame(TimeSpan.FromSeconds(12), 0, EasingType.Linear))
.Start(MyButton);
// Fade the image out and then back in
AnimationBuilder
.Create()
.Opacity().TimedKeyFrames(
delay: TimeSpan.FromSeconds(3),
build: b => b
.KeyFrame(TimeSpan.Zero, 1)
.KeyFrame(TimeSpan.FromSeconds(3), 0, EasingType.Linear)
.KeyFrame(TimeSpan.FromSeconds(6), 1, EasingType.Linear))
.Start(MyImage);
// Alternatively, a simpler but less efficient solution involves separate animations
await AnimationBuilder
.Create()
.Translation(Axis.Y, to: 32, duration: TimeSpan.FromSeconds(3), easingType: EasingType.Linear)
.StartAsync(MyButton);
await AnimationBuilder
.Create()
.Opacity(to: 0, duration: TimeSpan.FromSeconds(3), easingType: EasingType.Linear)
.StartAsync(MyImage);
await AnimationBuilder
.Create()
.Opacity(to: 1, duration: TimeSpan.FromSeconds(3), easingType: EasingType.Linear)
.StartAsync(MyImage);
await AnimationBuilder
.Create()
.Translation(Axis.Y, to: 0, duration: TimeSpan.FromSeconds(3), easingType: EasingType.Linear)
.StartAsync(MyButton);

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 27 KiB

Просмотреть файл

@ -17,11 +17,11 @@
<ComboBox x:Name="FrameSourceGroupCombo" Header="Frame Source Group" HorizontalAlignment="Left" Width="Auto">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding DisplayName}"></TextBlock>
<TextBlock Text="{Binding DisplayName}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBlock x:Name="CameraErrorTextBlock" Style="{StaticResource ErrorMessageStyle}" Margin="0,0,0,10" Visibility="Collapsed"></TextBlock>
<TextBlock x:Name="CameraErrorTextBlock" Style="{StaticResource ErrorMessageStyle}" Margin="0,0,0,10" Visibility="Collapsed"/>
<Button x:Name="CaptureButton" Content="Capture Video Frame" Margin="0,10" Click="CaptureButton_Click"></Button>
<Image x:Name="CurrentFrameImage" MinWidth="300" Width="400" HorizontalAlignment="Left"></Image>
</StackPanel>

Просмотреть файл

@ -9,7 +9,7 @@
<StackPanel Orientation="Vertical" Margin="20">
<controls:CameraPreview x:Name="CameraPreviewControl">
</controls:CameraPreview>
<TextBlock x:Name="ErrorMessage"></TextBlock>
<TextBlock x:Name="ErrorMessage"/>
<Image x:Name="CurrentFrameImage" MinWidth="300" Width="400" HorizontalAlignment="Left"></Image>
</StackPanel>
</Page>

Просмотреть файл

@ -14,7 +14,7 @@
<StackPanel Orientation="Vertical" Margin="20">
<controls:CameraPreview x:Name="CameraPreviewControl">
</controls:CameraPreview>
<TextBlock x:Name="ErrorMessage" Style="{StaticResource ErrorMessageStyle}"></TextBlock>
<TextBlock x:Name="ErrorMessage" Style="{StaticResource ErrorMessageStyle}"/>
<Image x:Name="CurrentFrameImage" MinWidth="300" Width="400" HorizontalAlignment="Left"></Image>
</StackPanel>
</Page>

Просмотреть файл

@ -95,7 +95,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
private Color _strokeColor;
private Color _fillColor;
private bool _selectionChanged = false;
private bool _isParsing = false;
private CanvasGeometry _errorGeometry;
private GeometryStreamReader _reader;
@ -172,9 +171,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
private void ParseData()
{
_data = InputData.Text;
_isParsing = true;
RenderCanvas.Invalidate();
_isParsing = false;
}
private void OnCanvasDraw(CanvasControl sender, CanvasDrawEventArgs args)

Просмотреть файл

@ -1,15 +0,0 @@
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ColorPickerButtonPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:primitives="using:Microsoft.Toolkit.Uwp.UI.Controls.Primitives"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
<Grid Visibility="Collapsed">
<controls:ColorPickerButton />
<primitives:ColorPickerSlider />
</Grid>
</Page>

Просмотреть файл

@ -1,20 +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.
using Microsoft.Toolkit.Uwp.UI.Controls;
using Windows.UI.Xaml.Controls;
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
/// <summary>
/// A page that shows how to use the <see cref="UI.Controls.ColorPicker"/> control.
/// </summary>
public sealed partial class ColorPickerButtonPage : Page
{
public ColorPickerButtonPage()
{
this.InitializeComponent();
}
}
}

Просмотреть файл

@ -1,17 +0,0 @@
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ColorPickerPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:primitives="using:Microsoft.Toolkit.Uwp.UI.Controls.Primitives"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid
Visibility="Collapsed">
<controls:ColorPicker />
<primitives:ColorPickerSlider />
</Grid>
</Page>

Просмотреть файл

@ -1,20 +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.
using Microsoft.Toolkit.Uwp.UI.Controls;
using Windows.UI.Xaml.Controls;
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
/// <summary>
/// A page that shows how to use the <see cref="UI.Controls.ColorPicker"/> control.
/// </summary>
public sealed partial class ColorPickerPage : Page
{
public ColorPickerPage()
{
this.InitializeComponent();
}
}
}

Просмотреть файл

@ -36,8 +36,8 @@
MaxWidth="500"
animations:Connected.AnchorElement="{x:Bind HeroElement}">
<TextBlock Text="Header" FontSize="50"></TextBlock>
<TextBlock TextWrapping="WrapWholeWords">Lorem ipsum ...</TextBlock>
<TextBlock Text="Header" FontSize="50"/>
<TextBlock TextWrapping="WrapWholeWords" Text="Lorem ipsum ..."/>
</StackPanel>
</StackPanel>
@ -77,9 +77,9 @@
animations:Connected.AnchorElement="{x:Bind ItemHeroElement}">
<TextBlock Text="{x:Bind item.Title}"
FontSize="50"></TextBlock>
FontSize="50"/>
<TextBlock TextWrapping="WrapWholeWords">Lorem ipsum ...</TextBlock>
<TextBlock TextWrapping="WrapWholeWords" Text="Lorem ipsum ..."/>
</StackPanel>
@ -90,7 +90,7 @@
</StackPanel>
<TextBlock Margin="0,40"
TextWrapping="WrapWholeWords">Lorem Ipsum ...</TextBlock>
TextWrapping="WrapWholeWords" Text="Lorem Ipsum ..."/>
</StackPanel>
<!-- /Page -->

Просмотреть файл

@ -9,7 +9,7 @@
<Grid Padding="20">
<TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center">This is the first page, Click/Tap the box to navigate to the next page</TextBlock>
<TextBlock VerticalAlignment="Bottom" HorizontalAlignment="Center" Text="This is the first page, Click/Tap the box to navigate to the next page"/>
<Border Height="100"
Width="100"

Просмотреть файл

@ -23,8 +23,8 @@
animations:Connected.Key="item"></Border>
<StackPanel x:Name="HeroDetailsElement" Margin="20,0" VerticalAlignment="Bottom" MaxWidth="500" animations:Connected.AnchorElement="{x:Bind HeroElement}">
<TextBlock Text="Header" FontSize="50"></TextBlock>
<TextBlock TextWrapping="WrapWholeWords">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eleifend ex sit amet blandit lobortis. Curabitur ut diam fringilla, interdum massa sit amet, facilisis erat. Donec vulputate sed ex vel pellentesque. In sodales odio non felis interdum viverra. Morbi in mi mollis, ullamcorper nibh sit amet, sagittis ex. Maecenas dapibus commodo venenatis. Donec at egestas est.</TextBlock>
<TextBlock Text="Header" FontSize="50"/>
<TextBlock TextWrapping="WrapWholeWords" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eleifend ex sit amet blandit lobortis. Curabitur ut diam fringilla, interdum massa sit amet, facilisis erat. Donec vulputate sed ex vel pellentesque. In sodales odio non felis interdum viverra. Morbi in mi mollis, ullamcorper nibh sit amet, sagittis ex. Maecenas dapibus commodo venenatis. Donec at egestas est."/>
</StackPanel>
</StackPanel>

Просмотреть файл

@ -15,8 +15,8 @@
VerticalAlignment="Bottom"
MaxWidth="500"
animations:Connected.AnchorElement="{x:Bind ItemHeroElement}">
<TextBlock Text="{x:Bind item.Title}" FontSize="50"></TextBlock>
<TextBlock TextWrapping="WrapWholeWords">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eleifend ex sit amet blandit lobortis. Curabitur ut diam fringilla, interdum massa sit amet, facilisis erat. Donec vulputate sed ex vel pellentesque. In sodales odio non felis interdum viverra. Morbi in mi mollis, ullamcorper nibh sit amet, sagittis ex. Maecenas dapibus commodo venenatis. Donec at egestas est.</TextBlock>
<TextBlock Text="{x:Bind item.Title}" FontSize="50"/>
<TextBlock TextWrapping="WrapWholeWords" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eleifend ex sit amet blandit lobortis. Curabitur ut diam fringilla, interdum massa sit amet, facilisis erat. Donec vulputate sed ex vel pellentesque. In sodales odio non felis interdum viverra. Morbi in mi mollis, ullamcorper nibh sit amet, sagittis ex. Maecenas dapibus commodo venenatis. Donec at egestas est."/>
</StackPanel>
<Image x:Name="ItemHeroElement"
Height="300" Width="300"
@ -24,7 +24,7 @@
animations:Connected.Key="listItem"/>
</StackPanel>
<TextBlock x:Name="Content" Margin="0,40" TextWrapping="WrapWholeWords" > Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eleifend ex sit amet blandit lobortis. Curabitur ut diam fringilla, interdum massa sit amet, facilisis erat. Donec vulputate sed ex vel pellentesque. In sodales odio non felis interdum viverra. Morbi in mi mollis, ullamcorper nibh sit amet, sagittis ex. Maecenas dapibus commodo venenatis. Donec at egestas est. Donec sit amet ante gravida, feugiat arcu quis, ullamcorper justo. Donec finibus erat lectus, pretium ultrices erat lobortis eu. Nulla sodales libero nisi, a varius urna vehicula et. In rhoncus magna sed felis ultricies aliquet. Sed rhoncus mi id elementum faucibus. Fusce blandit, urna sit amet maximus ultrices, lorem neque fermentum felis, id elementum tellus erat eu eros. Vivamus egestas, est eu sagittis vehicula, lorem nulla hendrerit elit, eu consectetur leo magna eu lorem. Nulla pulvinar augue vitae libero pretium molestie. Nam eget dui velit. Curabitur eu vehicula velit, eu convallis orci. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vestibulum et ipsum turpis. Ut volutpat condimentum elit, sit amet faucibus libero dignissim ac. Aenean vitae euismod lorem. Cras enim neque, hendrerit et dui vitae, viverra porttitor nisi. Aliquam suscipit dictum leo id consequat. Pellentesque condimentum elementum neque. Donec hendrerit nisi quis lorem sagittis, et aliquam dui suscipit. Cras at ligula vitae magna dignissim condimentum nec sagittis mauris. In hac habitasse platea dictumst. Donec tempor, dui et pretium pretium, libero magna iaculis eros, sed consequat nisi orci tempus est. Fusce in rutrum odio. Donec vitae porta metus, et pellentesque turpis. Nullam vestibulum lacus a metus sollicitudin vestibulum. Quisque lacinia quam et urna iaculis mattis. Vestibulum in justo ligula. Donec in dolor lacinia, semper risus eget, bibendum libero. Phasellus elementum odio vel facilisis gravida. Aliquam ac rutrum lacus, et aliquam arcu. Sed tempor rhoncus ipsum, nec viverra diam suscipit non. Nam fermentum commodo auctor. Praesent et nunc id nibh dignissim interdum. Phasellus fermentum mauris tortor, vel laoreet leo maximus sed. Nam sagittis risus lacinia quam dictum rutrum. Pellentesque mollis elit vel mauris eleifend auctor. Donec nec tincidunt odio. Morbi eleifend, turpis ullamcorper convallis vehicula, eros enim lobortis sapien, sit amet consequat risus lorem eu ligula. Quisque hendrerit scelerisque justo vel ultricies. Duis nec erat vulputate, sagittis nisi ut, congue tellus. Integer eget risus nec justo rutrum gravida. Sed eu aliquam nisl, consectetur euismod lacus. Etiam erat ligula, laoreet sed risus non, auctor sollicitudin lacus. Ut tincidunt lectus nec tempor interdum. Proin varius nisi enim, sed finibus urna tincidunt et. Suspendisse venenatis ex ut risus porttitor tempor. Vestibulum mauris ante, blandit in bibendum ac, aliquet quis leo. Aenean at facilisis nunc. Nullam blandit erat at orci tincidunt, in iaculis lorem viverra. Maecenas nec dui porta, tempus nulla nec, rhoncus felis. Ut vitae lectus a metus varius pretium at ut enim. Suspendisse potenti.</TextBlock>
<TextBlock x:Name="Content" Margin="0,40" TextWrapping="WrapWholeWords" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce eleifend ex sit amet blandit lobortis. Curabitur ut diam fringilla, interdum massa sit amet, facilisis erat. Donec vulputate sed ex vel pellentesque. In sodales odio non felis interdum viverra. Morbi in mi mollis, ullamcorper nibh sit amet, sagittis ex. Maecenas dapibus commodo venenatis. Donec at egestas est. Donec sit amet ante gravida, feugiat arcu quis, ullamcorper justo. Donec finibus erat lectus, pretium ultrices erat lobortis eu. Nulla sodales libero nisi, a varius urna vehicula et. In rhoncus magna sed felis ultricies aliquet. Sed rhoncus mi id elementum faucibus. Fusce blandit, urna sit amet maximus ultrices, lorem neque fermentum felis, id elementum tellus erat eu eros. Vivamus egestas, est eu sagittis vehicula, lorem nulla hendrerit elit, eu consectetur leo magna eu lorem. Nulla pulvinar augue vitae libero pretium molestie. Nam eget dui velit. Curabitur eu vehicula velit, eu convallis orci. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vestibulum et ipsum turpis. Ut volutpat condimentum elit, sit amet faucibus libero dignissim ac. Aenean vitae euismod lorem. Cras enim neque, hendrerit et dui vitae, viverra porttitor nisi. Aliquam suscipit dictum leo id consequat. Pellentesque condimentum elementum neque. Donec hendrerit nisi quis lorem sagittis, et aliquam dui suscipit. Cras at ligula vitae magna dignissim condimentum nec sagittis mauris. In hac habitasse platea dictumst. Donec tempor, dui et pretium pretium, libero magna iaculis eros, sed consequat nisi orci tempus est. Fusce in rutrum odio. Donec vitae porta metus, et pellentesque turpis. Nullam vestibulum lacus a metus sollicitudin vestibulum. Quisque lacinia quam et urna iaculis mattis. Vestibulum in justo ligula. Donec in dolor lacinia, semper risus eget, bibendum libero. Phasellus elementum odio vel facilisis gravida. Aliquam ac rutrum lacus, et aliquam arcu. Sed tempor rhoncus ipsum, nec viverra diam suscipit non. Nam fermentum commodo auctor. Praesent et nunc id nibh dignissim interdum. Phasellus fermentum mauris tortor, vel laoreet leo maximus sed. Nam sagittis risus lacinia quam dictum rutrum. Pellentesque mollis elit vel mauris eleifend auctor. Donec nec tincidunt odio. Morbi eleifend, turpis ullamcorper convallis vehicula, eros enim lobortis sapien, sit amet consequat risus lorem eu ligula. Quisque hendrerit scelerisque justo vel ultricies. Duis nec erat vulputate, sagittis nisi ut, congue tellus. Integer eget risus nec justo rutrum gravida. Sed eu aliquam nisl, consectetur euismod lacus. Etiam erat ligula, laoreet sed risus non, auctor sollicitudin lacus. Ut tincidunt lectus nec tempor interdum. Proin varius nisi enim, sed finibus urna tincidunt et. Suspendisse venenatis ex ut risus porttitor tempor. Vestibulum mauris ante, blandit in bibendum ac, aliquet quis leo. Aenean at facilisis nunc. Nullam blandit erat at orci tincidunt, in iaculis lorem viverra. Maecenas nec dui porta, tempus nulla nec, rhoncus felis. Ut vitae lectus a metus varius pretium at ut enim. Suspendisse potenti."/>
</StackPanel>
</Grid>
</Page>

Просмотреть файл

@ -38,7 +38,7 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Margin="12">
<TextBlock Text="DataGrid Sample : Mountains" VerticalAlignment="Center" Margin="5,0" Style="{ThemeResource SubtitleTextBlockStyle}"></TextBlock>
<TextBlock Text="DataGrid Sample : Mountains" VerticalAlignment="Center" Margin="5,0" Style="{ThemeResource SubtitleTextBlockStyle}"/>
<AppBarButton Icon="Filter" Label="Filter by">
<AppBarButton.Flyout>
<MenuFlyout>

Просмотреть файл

@ -8,7 +8,7 @@
mc:Ignorable="d" >
<Grid>
<TextBlock Margin="5" Text="In this demo you can't add a child after a Stretch child"></TextBlock>
<TextBlock Margin="5" Text="In this demo you can't add a child after a Stretch child"/>
<Grid Padding="48">
<controls:DockPanel x:Name="SampleDockPanel"
Background="LightGray"

Просмотреть файл

@ -24,7 +24,7 @@
<Grid>
<ScrollViewer Margin="15" VerticalScrollBarVisibility="Auto">
<StackPanel>
<TextBlock Style="{StaticResource TitleText}" >TextBlock</TextBlock>
<TextBlock Style="{StaticResource TitleText}" Text="TextBlock"/>
<Border Style="{StaticResource DividingBorder}" />
<controls:DropShadowPanel BlurRadius="@[BlurRadius:DoubleSlider:8.0:0.0-10.0]"
@ -35,17 +35,10 @@
VerticalAlignment="Center"
HorizontalAlignment="Center"
IsMasked="@[Is Masked:Bool:true]">
<TextBlock TextWrapping="Wrap">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eget sem luctus, gravida diam cursus, rutrum ipsum.
Pellentesque semper magna nec sapien ornare tincidunt. Sed pellentesque, turpis quis laoreet pellentesque, urna sapien efficitur nulla,
at interdum dolor sapien ut odio. Sed ullamcorper sapien velit, id finibus risus gravida vitae. Morbi ac ultrices lectus. Aenean felis
justo, aliquet a risus ut, condimentum malesuada metus. Duis vehicula pharetra dolor vel finibus. Nunc auctor tortor nunc, in varius velit
lobortis vel. Duis viverra, ante id mollis mattis, sem mauris ullamcorper dolor, sed rhoncus est erat eget ligula. Aliquam rutrum velit et
felis sollicitudin, eget dapibus dui accumsan.
</TextBlock>
<TextBlock TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. In eget sem luctus, gravida diam cursus, rutrum ipsum. Pellentesque semper magna nec sapien ornare tincidunt. Sed pellentesque, turpis quis laoreet pellentesque, urna sapien efficitur nulla, at interdum dolor sapien ut odio. Sed ullamcorper sapien velit, id finibus risus gravida vitae. Morbi ac ultrices lectus. Aenean felis justo, aliquet a risus ut, condimentum malesuada metus. Duis vehicula pharetra dolor vel finibus. Nunc auctor tortor nunc, in varius velit lobortis vel. Duis viverra, ante id mollis mattis, sem mauris ullamcorper dolor, sed rhoncus est erat eget ligula. Aliquam rutrum velit et felis sollicitudin, eget dapibus dui accumsan."/>
</controls:DropShadowPanel>
<TextBlock Style="{StaticResource TitleText}" >Shapes</TextBlock>
<TextBlock Style="{StaticResource TitleText}" Text="Shapes"/>
<Border Style="{StaticResource DividingBorder}" />
<StackPanel Orientation="Horizontal">
@ -83,7 +76,7 @@
</controls:DropShadowPanel>
</StackPanel>
<TextBlock Style="{StaticResource TitleText}">Images</TextBlock>
<TextBlock Style="{StaticResource TitleText}" Text="Images"/>
<Border Style="{StaticResource DividingBorder}" />
<StackPanel Orientation="Horizontal">

Просмотреть файл

@ -0,0 +1,16 @@
// 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.SampleApp.Enums
{
public enum Animal
{
Cat,
Dog,
Bunny,
Llama,
Parrot,
Squirrel
}
}

Просмотреть файл

@ -0,0 +1,33 @@
// 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.
using System;
using Microsoft.Toolkit.Uwp.SampleApp.Enums;
using Windows.UI;
using Windows.UI.Xaml.Data;
namespace Microsoft.Toolkit.Uwp.SampleApp.Converters
{
public sealed class AnimalToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return (Animal)value switch
{
Animal.Cat => Colors.Coral,
Animal.Dog => Colors.Gray,
Animal.Bunny => Colors.Green,
Animal.Llama => Colors.Beige,
Animal.Parrot => Colors.YellowGreen,
Animal.Squirrel => Colors.SaddleBrown,
_ => throw new ArgumentException("Invalid value", nameof(value))
};
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}

Просмотреть файл

@ -2,11 +2,8 @@
// 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 Microsoft.Toolkit.Uwp.SampleApp.Enums;
using Windows.UI;
using Microsoft.Toolkit.Uwp.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
@ -27,43 +24,4 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
}
}
}
#pragma warning disable SA1403 // File may only contain a single namespace
namespace Microsoft.Toolkit.Uwp.SampleApp.Enums
{
public enum Animal
{
Cat,
Dog,
Bunny,
Parrot,
Squirrel
}
}
namespace Microsoft.Toolkit.Uwp.SampleApp.Converters
{
public sealed class AnimalToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return (Animal)value switch
{
Animal.Cat => Colors.Coral,
Animal.Dog => Colors.Gray,
Animal.Bunny => Colors.Green,
Animal.Parrot => Colors.YellowGreen,
Animal.Squirrel => Colors.SaddleBrown,
_ => throw new ArgumentException("Invalid value", nameof(value))
};
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}
#pragma warning restore SA1403
}

Просмотреть файл

@ -52,8 +52,7 @@
VerticalAlignment="Center"
Text="&#xE76F;"
Foreground="{ThemeResource Brush-Alt}"
FontFamily="Segoe MDL2 Assets">
</TextBlock>
FontFamily="Segoe MDL2 Assets"/>
</Grid>
</controls:GridSplitter.Element>
</controls:GridSplitter>

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 3.7 KiB

После

Ширина:  |  Высота:  |  Размер: 3.7 KiB

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 5.8 KiB

После

Ширина:  |  Высота:  |  Размер: 5.8 KiB

Просмотреть файл

@ -20,7 +20,7 @@
<StackPanel Margin="0,64,0,0">
<wgt:PeoplePicker x:Name="PeopleChooser"
Visibility="{Binding ElementName=LoginButton, Path=UserDetails, Converter={StaticResource NullToVisibilityConverter}}"/>
<TextBlock Margin="0,8,0,0" FontWeight="Bold">Picked People:</TextBlock>
<TextBlock Margin="0,8,0,0" FontWeight="Bold" Text="Picked People:"/>
<ItemsControl ItemsSource="{Binding PickedPeople, ElementName=PeopleChooser}"
Margin="8,0,0,0">
<ItemsControl.ItemTemplate>

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 3.2 KiB

После

Ширина:  |  Высота:  |  Размер: 3.2 KiB

Просмотреть файл

@ -37,40 +37,28 @@
<Border Grid.Column="0"
Grid.Row="0">
<TextBlock>
This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect RowDefinition MinHeight="100"
</TextBlock>
<TextBlock Text="This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect RowDefinition MinHeight='100'"/>
</Border>
<Border Grid.Column="1"
Grid.Row="0">
<TextBlock>
This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect
</TextBlock>
<TextBlock Text="This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect"/>
</Border>
<Border Grid.Column="2"
Grid.Row="0">
<TextBlock>
This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect
</TextBlock>
<TextBlock Text="This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect"/>
</Border>
<Border Grid.Column="0"
Grid.Row="1">
<TextBlock>
This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect
</TextBlock>
<TextBlock Text="This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect"/>
</Border>
<Border Grid.Column="1"
Grid.Row="1">
<TextBlock>
This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect
</TextBlock>
<TextBlock Text="This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect"/>
</Border>
<Border Grid.Column="2"
Grid.Row="1">
<TextBlock>
This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect
</TextBlock>
<TextBlock Text="This text to simulate the resizing feature of the Grid Splitter Control, try to move the splitter to see the effect"/>
</Border>
<!--Column Grid Splitter-->
@ -103,8 +91,7 @@
VerticalAlignment="Center"
Text="&#xE76F;"
Foreground="White"
FontFamily="Segoe MDL2 Assets">
</TextBlock>
FontFamily="Segoe MDL2 Assets"/>
</controls:GridSplitter.Element>
</controls:GridSplitter>

Просмотреть файл

@ -14,8 +14,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
public sealed partial class InAppNotificationPage : Page, IXamlRenderListener
{
private ControlTemplate _defaultInAppNotificationControlTemplate;
private ControlTemplate _customInAppNotificationControlTemplate;
private InAppNotification _exampleInAppNotification;
private InAppNotification _exampleCustomInAppNotification;
private InAppNotification _exampleVSCodeInAppNotification;
@ -36,9 +34,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
NotificationDuration = 0;
_exampleInAppNotification = control.FindChild("ExampleInAppNotification") as InAppNotification;
_defaultInAppNotificationControlTemplate = _exampleInAppNotification?.Template;
_exampleCustomInAppNotification = control.FindChild("ExampleCustomInAppNotification") as InAppNotification;
_customInAppNotificationControlTemplate = _exampleCustomInAppNotification?.Template;
_exampleVSCodeInAppNotification = control.FindChild("ExampleVSCodeInAppNotification") as InAppNotification;
_resources = control.Resources;
@ -53,15 +49,15 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
SampleController.Current.RegisterNewCommand("Show notification with random text", (sender, args) =>
{
_exampleVSCodeInAppNotification?.Dismiss();
SetDefaultControlTemplate();
_exampleVSCodeInAppNotification.Dismiss(true);
_exampleCustomInAppNotification.Dismiss(true);
_exampleInAppNotification?.Show(GetRandomText(), NotificationDuration);
});
SampleController.Current.RegisterNewCommand("Show notification with object", (sender, args) =>
{
_exampleVSCodeInAppNotification?.Dismiss();
SetDefaultControlTemplate();
_exampleVSCodeInAppNotification.Dismiss(true);
_exampleCustomInAppNotification.Dismiss(true);
var random = new Random();
_exampleInAppNotification?.Show(new KeyValuePair<int, string>(random.Next(1, 10), GetRandomText()), NotificationDuration);
@ -69,8 +65,8 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
SampleController.Current.RegisterNewCommand("Show notification with buttons (without DataTemplate)", (sender, args) =>
{
_exampleVSCodeInAppNotification?.Dismiss();
SetDefaultControlTemplate();
_exampleVSCodeInAppNotification.Dismiss(true);
_exampleCustomInAppNotification.Dismiss(true);
var grid = new Grid()
{
@ -126,46 +122,30 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
SampleController.Current.RegisterNewCommand("Show notification with buttons (with DataTemplate)", (sender, args) =>
{
_exampleVSCodeInAppNotification?.Dismiss();
SetCustomControlTemplate(); // Use the custom template without the Dismiss button. The DataTemplate will handle re-adding it.
_exampleVSCodeInAppNotification.Dismiss(true);
_exampleInAppNotification.Dismiss(true);
object inAppNotificationWithButtonsTemplate = null;
bool? isTemplatePresent = _resources?.TryGetValue("InAppNotificationWithButtonsTemplate", out inAppNotificationWithButtonsTemplate);
if (isTemplatePresent == true && inAppNotificationWithButtonsTemplate is DataTemplate template)
object inAppNotificationWithButtonsTemplateResource = null;
bool? isTemplatePresent = _resources?.TryGetValue("InAppNotificationWithButtonsTemplate", out inAppNotificationWithButtonsTemplateResource);
if (isTemplatePresent == true && inAppNotificationWithButtonsTemplateResource is DataTemplate inAppNotificationWithButtonsTemplate)
{
_exampleInAppNotification.Show(template, NotificationDuration);
_exampleCustomInAppNotification.Show(inAppNotificationWithButtonsTemplate, NotificationDuration);
}
});
SampleController.Current.RegisterNewCommand("Show notification with Drop Shadow (based on default template)", (sender, args) =>
{
_exampleVSCodeInAppNotification.Dismiss();
SetDefaultControlTemplate();
// Update control template
object inAppNotificationDropShadowControlTemplate = null;
bool? isTemplatePresent = _resources?.TryGetValue("InAppNotificationDropShadowControlTemplate", out inAppNotificationDropShadowControlTemplate);
if (isTemplatePresent == true && inAppNotificationDropShadowControlTemplate is ControlTemplate template)
{
_exampleInAppNotification.Template = template;
}
_exampleInAppNotification.Show(GetRandomText(), NotificationDuration);
});
SampleController.Current.RegisterNewCommand("Show notification with Visual Studio Code template (info notification)", (sender, args) =>
{
_exampleInAppNotification.Dismiss();
_exampleInAppNotification.Dismiss(true);
_exampleCustomInAppNotification.Dismiss(true);
_exampleVSCodeInAppNotification.Show(NotificationDuration);
});
SampleController.Current.RegisterNewCommand("Dismiss", (sender, args) =>
{
// Dismiss all notifications (should not be replicated in production)
_exampleInAppNotification.Dismiss();
_exampleVSCodeInAppNotification.Dismiss();
_exampleInAppNotification.Dismiss(true);
_exampleCustomInAppNotification.Dismiss(true);
_exampleVSCodeInAppNotification.Dismiss(true);
});
}
@ -182,18 +162,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
}
}
private void SetDefaultControlTemplate()
{
// Update control template
_exampleInAppNotification.Template = _defaultInAppNotificationControlTemplate;
}
private void SetCustomControlTemplate()
{
// Update control template
_exampleInAppNotification.Template = _customInAppNotificationControlTemplate;
}
private void NotificationDurationTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
int newDuration;

Просмотреть файл

@ -18,6 +18,93 @@
<local:DismissCommand x:Key="DismissCommand" />
<Style TargetType="controls:InAppNotification" x:Key="MSEdgeNotificationTemplate_NoDismissButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="State">
<VisualState x:Name="Collapsed">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)">
<EasingDoubleKeyFrame KeyTime="0" Value="0" />
<EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"
Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)">
<EasingDoubleKeyFrame KeyTime="0" Value="0" />
<EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"
Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}"/>
</DoubleAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
<DiscreteObjectKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Visible">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)">
<EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" />
<EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)">
<EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" />
<EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="RootGrid"
RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}"
Margin="{TemplateBinding Margin}"
Padding="{TemplateBinding Padding}"
MaxWidth="{TemplateBinding MaxWidth}"
Visibility="{TemplateBinding Visibility}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid.RenderTransform>
<CompositeTransform />
</Grid.RenderTransform>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="PART_Presenter"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
HorizontalContentAlignment="Stretch"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
VerticalContentAlignment="Center"
TextWrapping="WrapWholeWords" />
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DismissTextBlockButtonStyle" TargetType="ButtonBase">
<Setter Property="Background" Value="{ThemeResource HyperlinkButtonBackground}" />
<Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}" />
@ -72,94 +159,7 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MSEdgeNotificationTemplate_NoDismissButton" TargetType="controls:InAppNotification">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="State">
<VisualState x:Name="Collapsed">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)">
<EasingDoubleKeyFrame KeyTime="0" Value="0" />
<EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"
Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)">
<EasingDoubleKeyFrame KeyTime="0" Value="0" />
<EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}"
Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}"/>
</DoubleAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
<DiscreteObjectKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Visible">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)">
<EasingDoubleKeyFrame KeyTime="0" Value="{Binding HorizontalOffset, RelativeSource={RelativeSource TemplatedParent}}" />
<EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="RootGrid"
Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)">
<EasingDoubleKeyFrame KeyTime="0" Value="{Binding VerticalOffset, RelativeSource={RelativeSource TemplatedParent}}" />
<EasingDoubleKeyFrame controls:InAppNotification.KeyFrameDuration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" Value="0" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="RootGrid"
RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}"
Margin="{TemplateBinding Margin}"
Padding="{TemplateBinding Padding}"
MaxWidth="{TemplateBinding MaxWidth}"
Visibility="{TemplateBinding Visibility}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid.RenderTransform>
<CompositeTransform />
</Grid.RenderTransform>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="PART_Presenter"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
HorizontalContentAlignment="Stretch"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
VerticalContentAlignment="Center"
TextWrapping="WrapWholeWords" />
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate x:Key="InAppNotificationWithButtonsTemplate">
<UserControl>
<Grid DataContext="{Binding ElementName=CurrentPage}">
@ -168,7 +168,7 @@
<VisualState x:Name="NarrowState">
<VisualState.Setters>
<Setter Target="TextBlock.Margin" Value="0" />
<Setter Target="ButtonsStackPanel.(Grid.Row)" Value="1" />
<Setter Target="ButtonsStackPanel.(Grid.Column)" Value="0" />
<Setter Target="ButtonsStackPanel.(Grid.ColumnSpan)" Value="3" />
@ -235,7 +235,7 @@
Height="32"
Width="100"
Command="{StaticResource DismissCommand}"
CommandParameter="{Binding ElementName=ExampleInAppNotification}"
CommandParameter="{Binding ElementName=ExampleCustomInAppNotification}"
AutomationProperties.Name="Ok" />
<Button x:Name="CancelButton"
@ -245,9 +245,8 @@
Height="32"
Width="100"
Command="{StaticResource DismissCommand}"
CommandParameter="{Binding ElementName=ExampleInAppNotification}"
CommandParameter="{Binding ElementName=ExampleCustomInAppNotification}"
AutomationProperties.Name="Cancel"/>
</StackPanel>
<Button x:Name="DismissButton"
@ -261,7 +260,7 @@
FontFamily="Segoe MDL2 Assets"
AutomationProperties.Name="Dismiss"
Command="{StaticResource DismissCommand}"
CommandParameter="{Binding ElementName=ExampleInAppNotification}"
CommandParameter="{Binding ElementName=ExampleCustomInAppNotification}"
VerticalAlignment="Center"
Visibility="{Binding ShowDismissButton, ElementName=ExampleCustomInAppNotification}">
<Button.RenderTransform>
@ -272,97 +271,10 @@
</Grid>
</UserControl>
</DataTemplate>
<ControlTemplate x:Key="InAppNotificationDropShadowControlTemplate">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="State">
<VisualState x:Name="Collapsed">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="RootGrid">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="RootGrid">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
<DiscreteObjectKeyFrame KeyTime="0:0:0.1">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Visible">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="RootGrid">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="RootGrid"
RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}"
Margin="{TemplateBinding Margin}"
MaxWidth="{TemplateBinding MaxWidth}"
Visibility="{TemplateBinding Visibility}">
<Grid.RenderTransform>
<CompositeTransform />
</Grid.RenderTransform>
<controls:DropShadowPanel BlurRadius="8" ShadowOpacity="0.7"
OffsetX="0.2" OffsetY="0.2"
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
<Grid Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="PART_Presenter"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
HorizontalContentAlignment="Stretch"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
VerticalContentAlignment="Center"
TextWrapping="WrapWholeWords" />
<Button x:Name="PART_DismissButton"
CornerRadius="20" Height="43" Width="48"
Grid.Column="1"
VerticalAlignment="Top"
Visibility="{Binding ShowDismissButton, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"
FontSize="12"
Style="{StaticResource DismissTextBlockButtonStyle}"
Content="&#xE894;"
FontFamily="Segoe MDL2 Assets"
AutomationProperties.Name="Dismiss">
<Button.RenderTransform>
<TranslateTransform x:Name="DismissButtonTransform" X="25" Y="-7"/>
</Button.RenderTransform>
</Button>
</Grid>
</controls:DropShadowPanel>
</Grid>
</Grid>
</ControlTemplate>
</ResourceDictionary>
</Page.Resources>
<Grid
Background="{ThemeResource Brush-Grey-04}">
<Grid Background="{ThemeResource Brush-Grey-04}">
<StackPanel Padding="20">
<StackPanel Margin="5">
<TextBox x:Name="NotificationDurationTextBox"
@ -391,15 +303,15 @@
</DataTemplate>
</controls:InAppNotification.ContentTemplate>
</controls:InAppNotification>
<controls:InAppNotification x:Name="ExampleCustomInAppNotification"
Style="{StaticResource MSEdgeNotificationTemplate_NoDismissButton}"
Content="This is a test message."
ShowDismissButton="@[ShowDismissButton:Bool:True]"
AnimationDuration="@[AnimationDuration:TimeSpan:100:0-5000]"
VerticalOffset="@[VerticalOffset:DoubleSlider:100.0:-200.0-200.0]"
HorizontalOffset="@[HorizontalOffset:DoubleSlider:0.0:-200.0-200.0]" />
Style="{StaticResource MSEdgeNotificationTemplate_NoDismissButton}"
ShowDismissButton="@[ShowDismissButton]"
AnimationDuration="@[AnimationDuration]"
VerticalOffset="@[VerticalOffset]"
HorizontalOffset="@[HorizontalOffset]"
StackMode="@[StackMode]" />
<controls:InAppNotification x:Name="ExampleVSCodeInAppNotification"
Style="{StaticResource VSCodeNotificationStyle}"

Просмотреть файл

@ -8,11 +8,11 @@
<Page.Resources>
<DataTemplate x:Name="NormalTemplate">
<TextBlock Text="{Binding Title}" Foreground="Green"></TextBlock>
<TextBlock Text="{Binding Title}" Foreground="Green"/>
</DataTemplate>
<DataTemplate x:Name="AlternateTemplate">
<TextBlock Text="{Binding Title}" Foreground="Red"></TextBlock>
<TextBlock Text="{Binding Title}" Foreground="Red"/>
</DataTemplate>
</Page.Resources>

Просмотреть файл

@ -1,19 +0,0 @@
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.LoginButtonPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:providers="using:Microsoft.Toolkit.Graph.Providers"
xmlns:wgt="using:Microsoft.Toolkit.Graph.Controls"
mc:Ignorable="d">
<Interactivity:Interaction.Behaviors>
<!--<providers:MockProviderBehavior SignedIn="False"/>-->
</Interactivity:Interaction.Behaviors>
<!-- Shallow Copy -->
<Grid>
<!--<wgt:LoginButton />-->
</Grid>
</Page>

Просмотреть файл

@ -1,21 +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.
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
public sealed partial class LoginButtonPage : Page, IXamlRenderListener
{
public LoginButtonPage()
{
InitializeComponent();
}
public void OnXamlRendered(FrameworkElement control)
{
}
}
}

Просмотреть файл

@ -1,18 +0,0 @@
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.PeoplePickerPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wgt="using:Microsoft.Toolkit.Graph.Controls"
mc:Ignorable="d">
<Page.Resources>
<converters:EmptyObjectToObjectConverter x:Key="NullToVisibilityConverter"
EmptyValue="Collapsed"
NotEmptyValue="Visible" />
</Page.Resources>
<!-- Shallow Copy -->
<Grid>
<!--<wgt:PeoplePicker/>-->
</Grid>
</Page>

Просмотреть файл

@ -1,27 +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.
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
/// <summary>
/// A page that shows how to use the opacity behavior.
/// </summary>
public sealed partial class PeoplePickerPage : Page, IXamlRenderListener
{
/// <summary>
/// Initializes a new instance of the <see cref="PeoplePickerPage"/> class.
/// </summary>
public PeoplePickerPage()
{
InitializeComponent();
}
public void OnXamlRendered(FrameworkElement control)
{
}
}
}

Просмотреть файл

@ -1,12 +0,0 @@
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.PersonViewPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wgt="using:Microsoft.Toolkit.Graph.Controls"
mc:Ignorable="d">
<!-- Shallow Copy -->
<Grid>
<!--<wgt:PersonView/>-->
</Grid>
</Page>

Просмотреть файл

@ -1,20 +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.
using Windows.UI.Xaml;
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
{
public sealed partial class PersonViewPage : IXamlRenderListener
{
public PersonViewPage()
{
InitializeComponent();
}
public void OnXamlRendered(FrameworkElement control)
{
}
}
}

Просмотреть файл

@ -0,0 +1,82 @@
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
xmlns:enums="using:Microsoft.Toolkit.Uwp.SampleApp.Enums"
mc:Ignorable="d">
<StackPanel Padding="16">
<!-- Basic Sample -->
<ComboBox x:Name="Lookup" Header="Look up reservation" SelectedIndex="0"
Margin="0,0,0,8">
<x:String>Select an option</x:String>
<x:String>Confirmation Code</x:String>
<x:String>E-ticket number</x:String>
<x:String>Mileage Plan number</x:String>
</ComboBox>
<!-- SwitchPresenter binds to a value -->
<controls:SwitchPresenter Value="{Binding SelectedItem, ElementName=Lookup}">
<!-- And then only dynamically displays the Case with the matching Value -->
<controls:Case Value="Confirmation Code">
<StackPanel>
<TextBox Name="ConfirmationCodeValidator"
ui:TextBoxExtensions.Regex="^[a-zA-Z]{6}$"
Header="Confirmation code"
PlaceholderText="6 letters" />
<TextBlock Visibility="{Binding (ui:TextBoxExtensions.IsValid), ElementName=ConfirmationCodeValidator}" Text="Thanks for entering a valid code!"/>
</StackPanel>
</controls:Case>
<controls:Case Value="E-ticket number">
<StackPanel>
<TextBox Name="TicketValidator"
ui:TextBoxExtensions.Regex="(^\d{10}$)|(^\d{13}$)"
Header="E-ticket number"
PlaceholderText="10 or 13 numbers" />
<TextBlock Visibility="{Binding (ui:TextBoxExtensions.IsValid), ElementName=TicketValidator}" Text="Thanks for entering a valid code!"/>
</StackPanel>
</controls:Case>
<controls:Case Value="Mileage Plan number">
<TextBox Name="PlanValidator"
Header="Mileage Plan #"
PlaceholderText="Mileage Plan #" />
</controls:Case>
<!-- You can also provide a default case if no match is found -->
<controls:Case IsDefault="True">
<TextBlock Text="Please select a way to lookup your reservation above..."/>
</controls:Case>
</controls:SwitchPresenter>
<Border Height="2" Background="Gray" Margin="0,16"/>
<!-- Scenario using an Enum -->
<ComboBox x:Name="AnimalPicker"
Header="Pick an Animal"
ItemsSource="{ui:EnumValues Type=enums:Animal}"
SelectedIndex="0"/>
<controls:SwitchPresenter Value="{Binding SelectedItem, ElementName=AnimalPicker}"
TargetType="enums:Animal"
Padding="16">
<controls:Case Value="Cat">
<TextBlock FontSize="32" Text="🐈"/>
</controls:Case>
<controls:Case Value="Dog">
<TextBlock FontSize="32" Text="🐕"/>
</controls:Case>
<controls:Case Value="Bunny">
<TextBlock FontSize="32" Text="🐇"/>
</controls:Case>
<controls:Case Value="Llama">
<TextBlock FontSize="32" Text="🦙"/>
</controls:Case>
<controls:Case Value="Parrot">
<TextBlock FontSize="32" Text="🦜"/>
</controls:Case>
<controls:Case Value="Squirrel">
<TextBlock FontSize="32" Text="🐿"/>
</controls:Case>
</controls:SwitchPresenter>
</StackPanel>
</Page>

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.2 KiB

Просмотреть файл

@ -30,7 +30,7 @@
Margin="20 20 20 5"
HorizontalAlignment="Left"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center">Orientation field in print dialog</TextBlock>
<TextBlock VerticalAlignment="Center" Text="Orientation field in print dialog"/>
<ToggleSwitch Margin="10,0,0,0"
Name="ShowOrientationSwitch"
OnContent="Show"
@ -40,7 +40,7 @@
Margin="20 5 20 20"
HorizontalAlignment="Left"
Orientation="Horizontal">
<TextBlock VerticalAlignment="Center">Default orientation setting</TextBlock>
<TextBlock VerticalAlignment="Center" Text="Default orientation setting"/>
<ComboBox Margin="10,0,0,0"
Name="DefaultOrientationComboBox">
</ComboBox>

Просмотреть файл

@ -21,7 +21,7 @@
<TextBlock Grid.Column="0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Text="{Binding RangeMin, ElementName=RangeSelectorControl, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.##}'}" />
Text="{Binding RangeStart, ElementName=RangeSelectorControl, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.##}'}" />
<controls:RangeSelector x:Name="RangeSelectorControl"
Grid.Column="1"
Minimum="@[Minimum:Slider:0:0-100]@"
@ -30,7 +30,7 @@
<TextBlock Grid.Column="2"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Text="{Binding RangeMax, ElementName=RangeSelectorControl, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.##}'}" />
Text="{Binding RangeEnd, ElementName=RangeSelectorControl, Converter={StaticResource StringFormatConverter}, ConverterParameter='{}{0:0.##}'}" />
</Grid>
</Grid>
</Page>

Просмотреть файл

@ -1,19 +0,0 @@
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.RangeSelectorPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<!-- Shallow Copy -->
<Page.Resources>
<converters:StringFormatConverter x:Key="StringFormatConverter" />
</Page.Resources>
<Grid Visibility="Collapsed">
<controls:RangeSelector />
</Grid>
</Page>

Просмотреть файл

@ -23,20 +23,20 @@
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock HorizontalAlignment="Right" Padding="5,0" Grid.Column="0" Grid.Row="0">IsValidEmail</TextBlock>
<TextBlock Grid.Column="1" Grid.Row="0" x:Name="IsValidEmailResult" Foreground="Blue" />
<TextBlock HorizontalAlignment="Right" Padding="5,0" Grid.Column="0" Grid.Row="0" Text="IsValidEmail"/>
<TextBlock Grid.Column="1" Grid.Row="0" x:Name="IsValidEmailResult" FontStyle="Italic"/>
<TextBlock HorizontalAlignment="Right" Padding="5,0" Grid.Column="0" Grid.Row="1">IsValidNumber</TextBlock>
<TextBlock Grid.Column="1" Grid.Row="1" x:Name="IsValidNumberResult" Foreground="Blue" />
<TextBlock HorizontalAlignment="Right" Padding="5,0" Grid.Column="0" Grid.Row="1" Text="IsValidNumber"/>
<TextBlock Grid.Column="1" Grid.Row="1" x:Name="IsValidNumberResult" FontStyle="Italic"/>
<TextBlock HorizontalAlignment="Right" Padding="5,0" Grid.Column="0" Grid.Row="2">IsValidDecimal</TextBlock>
<TextBlock Grid.Column="1" Grid.Row="2" x:Name="IsValidDecimalResult" Foreground="Blue" />
<TextBlock HorizontalAlignment="Right" Padding="5,0" Grid.Column="0" Grid.Row="2" Text="IsValidDecimal"/>
<TextBlock Grid.Column="1" Grid.Row="2" x:Name="IsValidDecimalResult" FontStyle="Italic"/>
<TextBlock HorizontalAlignment="Right" Padding="5,0" Grid.Column="0" Grid.Row="3">IsValidString</TextBlock>
<TextBlock Grid.Column="1" Grid.Row="3" x:Name="IsValidStringResult" Foreground="Blue" />
<TextBlock HorizontalAlignment="Right" Padding="5,0" Grid.Column="0" Grid.Row="3" Text="IsValidString"/>
<TextBlock Grid.Column="1" Grid.Row="3" x:Name="IsValidStringResult" FontStyle="Italic"/>
<TextBlock HorizontalAlignment="Right" Padding="5,0" Grid.Column="0" Grid.Row="4">IsValidPhoneNumber</TextBlock>
<TextBlock Grid.Column="1" Grid.Row="4" x:Name="IsValidPhoneNumberResult" Foreground="Blue" />
<TextBlock HorizontalAlignment="Right" Padding="5,0" Grid.Column="0" Grid.Row="4" Text="IsValidPhoneNumber"/>
<TextBlock Grid.Column="1" Grid.Row="4" x:Name="IsValidPhoneNumberResult" FontStyle="Italic"/>
</Grid>
</StackPanel>
</Grid>

Просмотреть файл

@ -35,10 +35,10 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
IsValidDecimalResult.FontWeight = InputTextBox.Text.IsDecimal() ? FontWeights.Bold : FontWeights.Normal;
IsValidStringResult.Text = InputTextBox.Text.IsCharacterString().ToString();
IsValidPhoneNumberResult.FontWeight = InputTextBox.Text.IsCharacterString() ? FontWeights.Bold : FontWeights.Normal;
IsValidStringResult.FontWeight = InputTextBox.Text.IsCharacterString() ? FontWeights.Bold : FontWeights.Normal;
IsValidPhoneNumberResult.Text = InputTextBox.Text.IsPhoneNumber().ToString();
IsValidPhoneNumberResult.FontWeight = InputTextBox.Text.IsPhoneNumber() ? FontWeights.Bold : FontWeights.Normal;
}
}
}
}

Просмотреть файл

@ -33,34 +33,34 @@
</Grid.RowDefinitions>
<TextBox Name="AlphaTextBox"
ui:TextBoxMask.Mask="9a9a-a9a*"
ui:TextBoxExtensions.Mask="9a9a-a9a*"
Header="Text box with Mask 9a9a-a9a* (9 allows from 0 to 9, a allow from a to Z and * allows both a and 9)"
HeaderTemplate="{StaticResource HeaderTemplate}"
Style="{StaticResource MaskedTextBoxStyle}"
Text="TextBoxMask" />
Text="TextBoxMask" />
<TextBox Grid.Row="1"
ui:TextBoxMask.Mask="+1999-9999"
ui:TextBoxMask.PlaceHolder=" "
ui:TextBoxExtensions.Mask="+1999-9999"
ui:TextBoxExtensions.MaskPlaceholder=" "
Header="Text box with Mask +1999-9999 and placeHolder as space (placeholder represents the characters the user can change on runtime)"
HeaderTemplate="{StaticResource HeaderTemplate}"
Style="{StaticResource MaskedTextBoxStyle}" />
<TextBox Grid.Row="2"
ui:TextBoxMask.Mask="+\964 799 999 9999"
ui:TextBoxExtensions.Mask="+\964 799 999 9999"
Header="Text box with Mask +964 799 999 9999 (Notice how we escape the first 9 with a backslash)"
HeaderTemplate="{StaticResource HeaderTemplate}"
Style="{StaticResource MaskedTextBoxStyle}" />
<TextBox Grid.Row="3"
ui:TextBoxMask.Mask="99\\99\\9999"
ui:TextBoxExtensions.Mask="99\\99\\9999"
Header="Text box with Mask 99\99\9999 (You can escape a backslash with another backslash)"
HeaderTemplate="{StaticResource HeaderTemplate}"
Style="{StaticResource MaskedTextBoxStyle}" />
<TextBox Grid.Row="4"
ui:TextBoxMask.CustomMask="5:[1-5],c:[a-c]"
ui:TextBoxMask.Mask="a5c-5c*9"
ui:TextBoxExtensions.CustomMask="5:[1-5],c:[a-c]"
ui:TextBoxExtensions.Mask="a5c-5c*9"
Header="Text box with CustomMask in case you want to define your own variable character like a, 9 and *. Mask: a5c-5c*9, 5: [1-5], c: [a-c]"
HeaderTemplate="{StaticResource HeaderTemplate}"
Style="{StaticResource MaskedTextBoxStyle}" />

Просмотреть файл

@ -11,10 +11,10 @@
<TextBox ui:TextBoxExtensions.Mask="9a9a--a9a*"/>
<TextBox ui:TextBoxExtensions.Mask="+1999-9999"
ui:TextBoxExtensions.PlaceHolder=" " />
ui:TextBoxExtensions.MaskPlaceholder=" " />
<TextBox ui:TextBoxExtensions.Mask="+\964 799 999 9999"
ui:TextBoxExtensions.PlaceHolder=" " />
ui:TextBoxExtensions.MaskPlaceholder=" " />
<TextBox ui:TextBoxExtensions.CustomMask="5:[1-5],c:[a-c]"
ui:TextBoxExtensions.Mask="a5c-5c*9" />

Просмотреть файл

@ -34,70 +34,70 @@
<StackPanel Margin="10,10,10,0">
<TextBox Name="PhoneNumberValidator"
ui:TextBoxRegex.Regex="^\s*\+?\s*([0-9][\s-]*){9,}$"
ui:TextBoxExtensions.Regex="^\s*\+?\s*([0-9][\s-]*){9,}$"
Header="Text box with Regex extension for phone number, validation occurs on TextChanged"
HeaderTemplate="{StaticResource HeaderTemplate}"
Style="{StaticResource TextBoxRegexStyle}" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="Is Valid: " />
<TextBlock Text="{Binding (ui:TextBoxRegex.IsValid), ElementName=PhoneNumberValidator, Converter={StaticResource StringFormatConverter}}" />
<TextBlock Text="{Binding (ui:TextBoxExtensions.IsValid), ElementName=PhoneNumberValidator, Converter={StaticResource StringFormatConverter}}" />
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="1"
Margin="10,10,10,0">
Margin="10,10,10,0">
<TextBox Name="CharactValidator"
ui:TextBoxRegex.ValidationMode="Dynamic"
ui:TextBoxRegex.ValidationType="Characters"
ui:TextBoxExtensions.ValidationMode="Dynamic"
ui:TextBoxExtensions.ValidationType="Characters"
Header="Text box with ValidationType=Characters, validation occurs at input with ValidationMode=Dynamic and clear only single character when value is invalid"
HeaderTemplate="{StaticResource HeaderTemplate}"
Style="{StaticResource TextBoxRegexStyle}"
Text="abcdef" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="Is Valid: " />
<TextBlock Text="{Binding (ui:TextBoxRegex.IsValid), ElementName=CharactValidator, Converter={StaticResource StringFormatConverter}}" />
<TextBlock Text="{Binding (ui:TextBoxExtensions.IsValid), ElementName=CharactValidator, Converter={StaticResource StringFormatConverter}}" />
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="2"
Margin="10,10,10,0">
Margin="10,10,10,0">
<TextBox Name="EmailValidator"
ui:TextBoxRegex.ValidationType="Email"
ui:TextBoxExtensions.ValidationType="Email"
Header="Text box with ValidationType=Email, validation occurs on TextChanged"
HeaderTemplate="{StaticResource HeaderTemplate}"
Style="{StaticResource TextBoxRegexStyle}" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="Is Valid: " />
<TextBlock Text="{Binding (ui:TextBoxRegex.IsValid), ElementName=EmailValidator, Converter={StaticResource StringFormatConverter}}" />
<TextBlock Text="{Binding (ui:TextBoxExtensions.IsValid), ElementName=EmailValidator, Converter={StaticResource StringFormatConverter}}" />
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="3"
Margin="10,10,10,0">
<TextBox Name="DecimalValidatorForce"
ui:TextBoxRegex.ValidationMode="Forced"
ui:TextBoxRegex.ValidationType="Decimal"
ui:TextBoxExtensions.ValidationMode="Forced"
ui:TextBoxExtensions.ValidationType="Decimal"
Header="Text box with ValidationType=Decimal, validation occurs on TextChanged and force occurs on lose focus with ValidationMode=Force (333,111 or 333.111)"
HeaderTemplate="{StaticResource HeaderTemplate}"
Style="{StaticResource TextBoxRegexStyle}" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="Is Valid: " />
<TextBlock Text="{Binding (ui:TextBoxRegex.IsValid), ElementName=DecimalValidatorForce, Converter={StaticResource StringFormatConverter}}" />
<TextBlock Text="{Binding (ui:TextBoxExtensions.IsValid), ElementName=DecimalValidatorForce, Converter={StaticResource StringFormatConverter}}" />
</StackPanel>
</StackPanel>
<StackPanel Grid.Row="4"
Margin="10,10,10,0">
<TextBox Name="NumberValidatorDynamic"
ui:TextBoxRegex.ValidationMode="Dynamic"
ui:TextBoxRegex.ValidationType="Number"
ui:TextBoxExtensions.ValidationMode="Dynamic"
ui:TextBoxExtensions.ValidationType="Number"
Header="Text box with ValidationType=Number, validation occurs at input with ValidationMode=Dynamic and clear only single character when value is invalid"
HeaderTemplate="{StaticResource HeaderTemplate}"
Style="{StaticResource TextBoxRegexStyle}" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="Is Valid: " />
<TextBlock Text="{Binding (ui:TextBoxRegex.IsValid), ElementName=NumberValidatorDynamic, Converter={StaticResource StringFormatConverter}}" />
<TextBlock Text="{Binding (ui:TextBoxExtensions.IsValid), ElementName=NumberValidatorDynamic, Converter={StaticResource StringFormatConverter}}" />
</StackPanel>
</StackPanel>

Просмотреть файл

@ -46,7 +46,7 @@
OffsetY="@[OffsetY:Slider:0:0-150]"
ScrollOrientation="@[Scroll Orientation:Enum:ScrollOrientation.Both]">
<Border Style="{StaticResource BorderStyle}">
<TextBlock Style="{StaticResource TextBlockStyle}" Text="Simple Content"></TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle}" Text="Simple Content"/>
</Border>
</controls:TileControl>
@ -64,11 +64,11 @@
<FlipView x:Name="FlipView">
<Border Style="{StaticResource BorderStyle}">
<TextBlock Style="{StaticResource TextBlockStyle}" Text="Parallax with FlipView &gt;"></TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle}" Text="Parallax with FlipView &gt;"/>
</Border>
<Border Style="{StaticResource BorderStyle}">
<TextBlock Style="{StaticResource TextBlockStyle}" Text="&lt; Parallax with FlipView"></TextBlock>
<TextBlock Style="{StaticResource TextBlockStyle}" Text="&lt; Parallax with FlipView"/>
</Border>
</FlipView>
</controls:TileControl>

Просмотреть файл

@ -13,8 +13,6 @@
mc:Ignorable="d">
<Grid>
<TextBlock Margin="16">
Modify the XAML to change the Title.
</TextBlock>
<TextBlock Margin="16" Text="Modify the XAML to change the Title."/>
</Grid>
</Page>

Просмотреть файл

@ -67,7 +67,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
_logs.Clear();
}
private async void EffectElementHost_EnteredViewport(object sender, EventArgs e)
private void EffectElementHost_EnteredViewport(object sender, EventArgs e)
{
AddLog("Entered viewport");
@ -81,7 +81,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
_effectElement.Source = new BitmapImage(new Uri("ms-appx:///Assets/ToolkitLogo.png"));
}
private async void EffectElementHost_ExitedViewport(object sender, EventArgs e)
private void EffectElementHost_ExitedViewport(object sender, EventArgs e)
{
AddLog("Exited viewport");

Просмотреть файл

@ -32,8 +32,13 @@
</Grid>
</DataTemplate>
<Style TargetType="ListViewItem">
<!-- Change those values to change the WrapPanel's children alignment -->
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="0" />
</Style>
</Page.Resources>
@ -49,16 +54,6 @@
HorizontalSpacing="@[HorizontalSpacing:Slider:5:0-200]@" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<!-- Change those values to change the WrapPanel's children alignment -->
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="0" />
<Setter Property="MinWidth" Value="0" />
<Setter Property="MinHeight" Value="0" />
</Style>
</ListView.ItemContainerStyle>
</ListView>
</Grid>
</Page>

Просмотреть файл

@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ani="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:interactions="using:Microsoft.Xaml.Interactions.Core"
@ -10,6 +11,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:media="using:Microsoft.Toolkit.Uwp.UI.Media"
xmlns:mediaactions="using:Microsoft.Xaml.Interactions.Media"
xmlns:primitives="using:Microsoft.Toolkit.Uwp.UI.Controls.Primitives"
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
@ -19,8 +21,9 @@
<!-- Put a copy of any controls/resources required for XAML Parsing within XAML Only Samples -->
<!-- This page is never loaded by the app, but used to trick the compiler... -->
<Page.Resources>
<converters:VisibilityToBoolConverter x:Key="VisibilityBoolConverter" />
<converters:BoolToVisibilityConverter x:Key="BoolVisibilityConverter" />
<converters:VisibilityToBoolConverter x:Key="VisibilityBoolConverter" />
<converters:StringFormatConverter x:Key="StringFormatConverter" />
<triggers:CompareStateTrigger x:Key="CompareStateTrigger" />
<triggers:IsEqualStateTrigger x:Key="IsEqualStateTrigger" />
<triggers:IsNotEqualStateTrigger x:Key="IsNotEqualStateTrigger" />
@ -29,11 +32,20 @@
<triggers:UserHandPreferenceStateTrigger x:Key="UserHandPreferenceStateTrigger" />
<triggers:UserInteractionModeStateTrigger x:Key="UserInteractionModeStateTrigger" />
<behaviors:StartAnimationAction x:Key="StartAnimationAction" />
<controls:ColorPicker x:Key="ColorPicker" />
<controls:ColorPickerButton x:Key="ColorPickerButton" />
<primitives:ColorPickerSlider x:Key="ColorPickerSlider" />
<controls:RangeSelector x:Key="RangeSelector" />
<TextBox x:Key="TextBoxExtensions">
<ui:TextBoxExtensions.SurfaceDialOptions>
<ui:SurfaceDialOptions />
</ui:TextBoxExtensions.SurfaceDialOptions>
</TextBox>
<controls:SwitchPresenter x:Key="SwitchPresenterControl">
<controls:CaseCollection>
<controls:Case IsDefault="True" />
</controls:CaseCollection>
</controls:SwitchPresenter>
</Page.Resources>
<Grid>

Просмотреть файл

@ -36,23 +36,21 @@
},
{
"Name": "ColorPicker",
"Type": "ColorPickerPage",
"Subcategory": "Input",
"About": "An improved color picker control providing more options to select colors.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker",
"XamlCodeFile": "ColorPickerXaml.bind",
"XamlCodeFile": "/SamplePages/ColorPicker/ColorPickerXaml.bind",
"Icon": "/SamplePages/ColorPicker/ColorPicker.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/ColorPicker.md"
},
{
"Name": "ColorPickerButton",
"Type": "ColorPickerButtonPage",
"Subcategory": "Input",
"About": "A color picker within a flyout opened by pressing a dropdown button containing the selected color.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Input/ColorPicker",
"XamlCodeFile": "/SamplePages/ColorPicker/ColorPickerButtonXaml.bind",
"Icon": "/SamplePages/ColorPicker/ColorPicker.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/ColorPickerButton.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/ColorPicker.md"
},
{
"Name": "AdaptiveGridView",
@ -76,11 +74,10 @@
},
{
"Name": "RangeSelector",
"Type": "RangeSelectorPage",
"Subcategory": "Input",
"About": "The RangeSelector is a \"double slider\" control for range values.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Input/RangeSelector",
"XamlCodeFile": "RangeSelectorCode.bind",
"XamlCodeFile": "/SamplePages/RangeSelector/RangeSelectorCode.bind",
"Icon": "/SamplePages/RangeSelector/RangeSelector.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/RangeSelector.md"
},
@ -386,44 +383,39 @@
"Icon": "/SamplePages/Eyedropper/Eyedropper.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/Eyedropper.md"
},
/* TODO Reintroduce graph controls
{
"Name": "LoginButton",
"Type": "LoginButtonPage",
"Subcategory": "Graph",
"About": "The LoginButton control is a button and flyout to facilitate Microsoft identity platform authentication for AAD or MSA accounts.",
"CodeUrl": "https://github.com/windows-toolkit/Graph-Controls/tree/master/Microsoft.Toolkit.Graph.Controls/Controls/LoginButton",
"XamlCodeFile": "LoginButtonXaml.bind",
"Icon": "/SamplePages/LoginButton/LoginButton.png",
/*"XamlCodeFile": "/SamplePages/Graph/LoginButtonXaml.bind",*/
"Icon": "/SamplePages/Graph/LoginButton.png",
"BadgeUpdateVersionRequired": "PREVIEW",
"DeprecatedWarning": "The LoginButton control is in preview. Find out more here: https://aka.ms/wgt",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/graph/controls/LoginButton.md"
},
{
"Name": "PersonView",
"Type": "PersonViewPage",
"Subcategory": "Graph",
"About": "The PersonView control is used to display a person or contact by using their photo, name, and/or email address from Microsoft Graph.",
"CodeUrl": "https://github.com/windows-toolkit/Graph-Controls/tree/master/Microsoft.Toolkit.Graph.Controls/Controls/PersonView",
"XamlCodeFile": "PersonViewXaml.bind",
"Icon": "/SamplePages/PersonView/PersonView.png",
/*"XamlCodeFile": "/SamplePages/Graph/PersonViewXaml.bind",*/
"Icon": "/SamplePages/Graph/PersonView.png",
"BadgeUpdateVersionRequired": "PREVIEW",
"DeprecatedWarning": "The PersonView control is in preview. Find out more here: https://aka.ms/wgt",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/graph/controls/PersonView.md"
},
{
"Name": "PeoplePicker",
"Type": "PeoplePickerPage",
"Subcategory": "Graph",
"About": "The PeoplePicker Control searchs for people and renders the list of results from Microsoft Graph. By default, the component will search for all people.",
"CodeUrl": "https://github.com/windows-toolkit/Graph-Controls/tree/master/Microsoft.Toolkit.Graph.Controls/Controls/PeoplePicker",
"XamlCodeFile": "PeoplePickerXaml.bind",
"Icon": "/SamplePages/PeoplePicker/PeoplePicker.png",
/*"XamlCodeFile": "/SamplePages/Graph/PeoplePickerXaml.bind",*/
"Icon": "/SamplePages/Graph/PeoplePicker.png",
"BadgeUpdateVersionRequired": "PREVIEW",
"DeprecatedWarning": "The PeoplePicker control is in preview. Find out more here: https://aka.ms/wgt",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/graph/controls/PeoplePicker.md"
},
*/
{
"Name": "AlignmentGrid",
"Type": "AlignmentGridPage",
@ -463,6 +455,15 @@
"XamlCodeFile": "/SamplePages/TabbedCommandBar/TabbedCommandBar.bind",
"Icon": "/SamplePages/TabbedCommandBar/TabbedCommandBar.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/TabbedCommandBar.md"
},
{
"Name": "SwitchPresenter",
"Subcategory": "Layout",
"About": "The SwitchPresenter is a ContentPresenter which can allow a developer to mimic a switch statement within XAML.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Primitives/SwitchPresenter",
"XamlCodeFile": "/SamplePages/Primitives/SwitchPresenter.bind",
"Icon": "/SamplePages/Primitives/SwitchPresenter.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/SwitchPresenter.md"
}
]
},
@ -474,27 +475,31 @@
"Name": "StartAnimationActivity",
"Subcategory": "Activities",
"About": "Activity for Animations to Start another Animation",
"Icon": "/Assets/Helpers.png",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Animations/Xaml/Activities",
"XamlCodeFile": "/SamplePages/Animations/Activities/StartAnimationActivity.bind",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/Fade.md"
"CodeFile": "/SamplePages/Animations/Activities/StartAnimationActivityCode.bind",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/AnimationSet.md"
},
{
"Name": "InvokeActionsActivity",
"Subcategory": "Activities",
"Icon": "/Assets/Helpers.png",
"About": "Activity chaining Actions from the Behaviors package into an Animation schedule.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Behaviors/Animations",
"CodeFile": "/SamplePages/Animations/Activities/InvokeActionsActivityCode.bind",
"XamlCodeFile": "/SamplePages/Animations/Activities/InvokeActionsActivity.bind",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/Fade.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/AnimationSet.md"
},
{
"Name": "Fade",
"Subcategory": "Effect",
"Subcategory": "Behavior",
"About": "Opacity of XAML elements using composition animations",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Animations/Behaviors",
"CodeFile": "/SamplePages/Animations/Effects/FadeBehaviorCode.bind",
"XamlCodeFile": "/SamplePages/Animations/Effects/FadeBehaviorXaml.bind",
"Icon": "/SamplePages/Animations/Effects/FadeBehavior.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/Fade.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/AnimationSet.md"
},
{
"Name": "Scale",
@ -504,7 +509,7 @@
"CodeFile": "/SamplePages/Animations/Behaviors/ScaleBehaviorCode.bind",
"XamlCodeFile": "/SamplePages/Animations/Behaviors/ScaleBehaviorXaml.bind",
"Icon": "/SamplePages/Animations/Behaviors/ScaleBehavior.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/Scale.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/AnimationSet.md"
},
{
"Name": "Offset",
@ -514,7 +519,7 @@
"CodeFile": "/SamplePages/Animations/Behaviors/OffsetBehaviorCode.bind",
"XamlCodeFile": "/SamplePages/Animations/Behaviors/OffsetBehaviorXaml.bind",
"Icon": "/SamplePages/Animations/Behaviors/OffsetBehavior.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/Offset.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/AnimationSet.md"
},
{
"Name": "Rotate",
@ -524,7 +529,7 @@
"CodeFile": "/SamplePages/Animations/Behaviors/RotateBehaviorCode.bind",
"XamlCodeFile": "/SamplePages/Animations/Behaviors/RotateBehaviorXaml.bind",
"Icon": "/SamplePages/Animations/Behaviors/RotateBehavior.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/Rotate.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/AnimationSet.md"
},
{
"Name": "Blur",
@ -535,7 +540,7 @@
"XamlCodeFile": "/SamplePages/Animations/Behaviors/BlurBehaviorXaml.bind",
"Icon": "/SamplePages/Animations/Behaviors/BlurBehavior.png",
"BadgeUpdateVersionRequired": "Anniversary Update required",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/Blur.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/brushes/PipelineVisualFactory.md"
},
{
"Name": "Saturation",
@ -546,7 +551,7 @@
"XamlCodeFile": "/SamplePages/Animations/Behaviors/SaturationBehaviorXaml.bind",
"Icon": "/SamplePages/Animations/Behaviors/SaturationBehavior.png",
"BadgeUpdateVersionRequired": "Anniversary Update required",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/Saturation.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/brushes/PipelineVisualFactory.md"
},
{
"Name": "FadeHeader",
@ -576,15 +581,16 @@
"XamlCodeFile": "ItemsReorderAnimation.bind",
"Icon": "/SamplePages/ItemsReorderAnimation/ItemsReorderAnimation.png",
"BadgeUpdateVersionRequired": "Anniversary Update required",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/ReorderGrid.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/ItemsReorderAnimation.md"
},
{
"Name": "EffectAnimations",
"Subcategory": "Effect",
"About": "Effects from the Media package that can be animated from an AnimationSet schedule.",
"Icon": "/SamplePages/Animations/Effects/EffectAnimations.png",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Media/Animations",
"XamlCodeFile": "/SamplePages/Animations/Effects/EffectAnimations.bind",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/Fade.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/AnimationSet.md"
},
{
"Name": "Implicit Animations",
@ -595,7 +601,7 @@
"Icon": "/SamplePages/Implicit Animations/ImplicitAnimations.png",
"XamlCodeFile": "ImplicitAnimationsCode.bind",
"BadgeUpdateVersionRequired": "Creators Update required",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/ImplicitAnimations.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/ImplicitAnimationSet.md"
},
{
"Name": "Connected Animations",
@ -611,60 +617,6 @@
}
]
},
{
"Name": "WPF and WinForms Controls",
"Samples": [
{
"Name": "WindowsXamlHost",
"About": "This guide helps you add UWP XAML controls to your WPF",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/wpf-winforms/WindowsXamlHost.md",
"CodeUrl": "https://github.com/windows-toolkit/Microsoft.Toolkit.Win32"
},
{
"Name": "WebView",
"About": "The Windows Community Toolkit provides a version of the UWP web view control that can be used in WPF and Windows Forms applications. This control embeds a view into your application that renders web content using the Microsoft Edge rendering engine",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/wpf-winforms/WebView.md",
"CodeUrl": "https://github.com/windows-toolkit/Microsoft.Toolkit.Win32"
},
{
"Name": "WebViewCompatible",
"About": "The Windows Community Toolkit provides a version of the UWP web view control that can be used in WPF and Windows Forms applications. This control embeds a view into your application that renders web content in one of two ways. For client environments that support the WebViewControl (Windows 10), that implementation is used. For legacy systems, System.Windows.Controls.WebBrowser implements the view",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/wpf-winforms/WebViewCompatible.md",
"CodeUrl": "https://github.com/windows-toolkit/Microsoft.Toolkit.Win32"
},
{
"Name": "InkCanvas",
"About": "This control is a wrapper to enable use of the UWP InkCanvas control in Windows Forms or WPF",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/wpf-winforms/InkCanvas.md",
"CodeUrl": "https://github.com/windows-toolkit/Microsoft.Toolkit.Win32"
},
{
"Name": "InkToolbar",
"About": "This control is a wrapper to enable use of the UWP InkToolbar control in Windows Forms or WPF",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/wpf-winforms/InkToolbar.md",
"CodeUrl": "https://github.com/windows-toolkit/Microsoft.Toolkit.Win32"
},
{
"Name": "MediaPlayerElement",
"About": "This control is a wrapper to enable use of the UWP MediaPlayerElement control in Windows Forms or WPF",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/wpf-winforms/MediaPlayerElement.md",
"CodeUrl": "https://github.com/windows-toolkit/Microsoft.Toolkit.Win32"
},
{
"Name": "MapControl",
"About": "This control is a wrapper to enable use of the UWP MapControl control in Windows Forms or WPF",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/wpf-winforms/MapControl.md",
"CodeUrl": "https://github.com/windows-toolkit/Microsoft.Toolkit.Win32"
}
]
},
{
"Name": "Services",
"Icon": "Icons/Services.png",
@ -772,10 +724,10 @@
"Type": "DispatcherQueueHelperPage",
"Subcategory": "Developer",
"About": "Allows easy interaction with Windows Runtime message dispatcher queue for multi-threaded scenario (I.E: Run code on UI thread).",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp/Helpers/DispatcherQueueHelper.cs",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp/Extensions/DispatcherQueueExtensions.cs",
"CodeFile": "DispatcherQueueHelperCode.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/DispatcherQueueHelper.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/DispatcherQueueExtensions.md"
},
{
"Name": "AdvancedCollectionView",
@ -792,7 +744,7 @@
"Type": "ObservableGroupPage",
"Subcategory": "Data",
"About": "Allows you to easily create observable grouped collections.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit/ObservableGroup",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit/Collections",
"CodeFile": "ObservableGroup.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/collections/ObservableGroups.md"
@ -813,6 +765,7 @@
"Type": "ThemeListenerPage",
"Subcategory": "Systems",
"About": "The ThemeListener allows you to keep track of changes to the System Theme.",
"CodeUrl" : "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Helpers/ThemeListener.cs",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/ThemeListener.md"
},
@ -831,31 +784,31 @@
"Type": "ViewportBehaviorPage",
"Subcategory": "Systems",
"About": "Behavior for listening element enter or exit viewport",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Behaviors",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Behaviors/Viewport",
"CodeFile": "ViewportBehaviorCode.bind",
"XamlCodeFile": "ViewportBehaviorXaml.bind",
"Icon": "/SamplePages/ViewportBehavior/ViewportBehavior.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/animations/ViewportBehavior.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/ViewportBehavior.md"
},
{
"Name": "AutoFocusBehavior",
"Type": "AutoFocusBehaviorPage",
"Subcategory": "Systems",
"About": "Behavior to automatically set the focus on a control when it loads",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Behaviors/",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI.Behaviors/Focus/AutoFocusBehavior.cs",
"XamlCodeFile": "AutoFocusBehaviorXaml.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/AutoFocusBehavior.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/FocusBehaviors.md"
},
{
"Name": "FocusBehavior",
"Type": "FocusBehaviorPage",
"Subcategory": "Systems",
"About": "Behavior to automatically set the focus on the first control which accepts it",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Behaviors/",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI.Behaviors/Focus/FocusBehavior.cs",
"CodeFile": "FocusBehaviorXaml.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/FocusBehavior.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/behaviors/FocusBehaviors.md"
},
{
"Name": "AutoSelectBehavior",
@ -872,6 +825,7 @@
"Type": "CanvasPathGeometryPage",
"Subcategory": "Parser",
"About": "CanvasPathGeometry class allows you to convert Win2d Path Mini Language string to CanvasGeometry, Brushes, CanvasStrokes or CanvasStrokeStyles.",
"CodeUrl" : "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Media/Geometry",
"Icon": "/SamplePages/CanvasPathGeometry/CanvasPathGeometry.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/parsers/CanvasPathGeometry.md"
},
@ -880,7 +834,7 @@
"Type": "LiveTilePage",
"Subcategory": "Notifications",
"About": "This shows how to update a Live Tile with a rich Adaptive notification.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.Notifications",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.Notifications/Tiles",
"CodeFile": "LiveTileCode.bind",
"Icon": "/SamplePages/LiveTile/LiveTile.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/notifications/NotificationsOverview.md"
@ -890,7 +844,7 @@
"Type": "ToastPage",
"Subcategory": "Notifications",
"About": "This shows how to send a Toast notification.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.Notifications",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.Notifications/Toasts",
"CodeFile": "ToastCode.bind",
"Icon": "/SamplePages/Toast/Toast.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/notifications/NotificationsOverview.md"
@ -909,6 +863,7 @@
"Name": "Guard APIs",
"Subcategory": "Developer",
"About": "The Guard APIs can be used to validate method arguments in a streamlined manner, which is also faster, less verbose, more expressive and less error prone than manually writing checks and throwing exceptions.",
"CodeUrl" : "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Diagnostics",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/developer-tools/Guard.md"
},
@ -916,14 +871,23 @@
"Name": "High Performance APIs",
"Subcategory": "Developer",
"About": "The High Performance package contains a set of APIs that are heavily focused on optimization. All the new APIs have been carefully crafted to achieve the best possible performance when using them, either through reduced memory allocation, micro-optimizations at the assembly level, or by structuring the APIs in a way that facilitates writing performance oriented code in general.",
"CodeUrl" : "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.HighPerformance",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/high-performance/Introduction.md"
},
{
"Name": "MVVM Toolkit",
"Subcategory": "Developer",
"About": "The MVVM Toolkit package is a modern, fast, and modular MVVM library for .NET Standard 2.0.",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/mvvm/Introduction.md",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Mvvm"
},
{
"Name": "CompareStateTrigger",
"Subcategory": "State Triggers",
"About": "Enables a state if the value is equal to, greater than, or less than another value",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Triggers/CompareStateTrigger.cs",
"XamlCodeFile": "/SamplePages/Triggers/CompareStateTrigger.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/Triggers.md"
@ -932,7 +896,7 @@
"Name": "IsEqualStateTrigger",
"Subcategory": "State Triggers",
"About": "Enables a state if the value is equal to another value",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Triggers/IsEqualStateTrigger.cs",
"XamlCodeFile": "/SamplePages/Triggers/IsEqualStateTrigger.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/Triggers.md"
@ -942,7 +906,7 @@
"Type": "FullScreenModeStateTriggerPage",
"Subcategory": "State Triggers",
"About": "Trigger for switching when in full screen mode",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Triggers/FullScreenModeStateTrigger.cs",
"XamlCodeFile": "/SamplePages/Triggers/FullScreenModeStateTrigger.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/Triggers.md"
@ -952,7 +916,7 @@
"Type": "IsNullOrEmptyStateTriggerPage",
"Subcategory": "State Triggers",
"About": "Enables a state if an Object is null or a String/IEnumerable is empty",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Triggers/IsNullOrEmptyStateTrigger.cs",
"XamlCodeFile": "/SamplePages/Triggers/IsNullOrEmptyStateTrigger.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/Triggers.md"
@ -961,7 +925,7 @@
"Name": "NetworkConnectionStateTrigger",
"Subcategory": "State Triggers",
"About": "Trigger for switching when the network availability changes",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Triggers/NetworkConnectionStateTrigger.cs",
"XamlCodeFile": "/SamplePages/Triggers/NetworkConnectionStateTrigger.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/Triggers.md"
@ -970,7 +934,7 @@
"Name": "IsNotEqualStateTrigger",
"Subcategory": "State Triggers",
"About": "Enables a state if the value is not equal to another value",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Triggers/IsNotEqualStateTrigger.cs",
"XamlCodeFile": "/SamplePages/Triggers/IsNotEqualStateTrigger.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/Triggers.md"
@ -979,7 +943,7 @@
"Name": "RegexStateTrigger",
"Subcategory": "State Triggers",
"About": "Enables a state if the regex expression is true for a given string value",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Triggers/RegexStateTrigger.cs",
"XamlCodeFile": "/SamplePages/Triggers/RegexStateTrigger.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/Triggers.md"
@ -988,7 +952,7 @@
"Name": "UserHandPreferenceStateTrigger",
"Subcategory": "State Triggers",
"About": "Trigger for switching UI based on whether the user favours their left or right hand.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Triggers/UserHandPreferenceStateTrigger.cs",
"XamlCodeFile": "/SamplePages/Triggers/UserHandPreferenceStateTrigger.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/Triggers.md"
@ -997,7 +961,7 @@
"Name": "UserInteractionModeStateTrigger",
"Subcategory": "State Triggers",
"About": "Trigger for switching when the User interaction mode changes (tablet mode)",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Triggers",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Triggers/UserInteractionModeStateTrigger.cs",
"XamlCodeFile": "/SamplePages/Triggers/UserInteractionModeStateTrigger.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/helpers/Triggers.md"
@ -1094,11 +1058,11 @@
{
"Name": "VisualEffectFactory",
"About": "A composition pipeline which can render any custom Win2D/Composition effects chain directly on a Composition visual.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Media/Brushes/PipelineBrush.cs",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Media/Visuals",
"XamlCodeFile": "VisualEffectFactory.bind",
"Icon": "/SamplePages/PipelineBrush/PipelineBrush.png",
"ApiCheck": "Windows.UI.Xaml.Media.XamlCompositionBrushBase",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/brushes/PipelineBrush.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/brushes/PipelineVisualFactory.md"
},
{
"Name": "AcrylicBrush",
@ -1130,7 +1094,7 @@
"Name": "ListViewExtensions",
"Type": "ListViewExtensionsPage",
"About": "Extensions for all controls that inherit from ListViewBase like ListView.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewExtensions",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/ListViewBase",
"XamlCodeFile": "ListViewExtensionsCode.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/ListViewExtensions.md"
@ -1148,7 +1112,7 @@
"Name": "TextBoxMask",
"Type": "TextBoxMaskPage",
"About": "TextBox Mask property allows a user to more easily enter fixed width text in TextBox control where you would like them to enter the data in a certain format",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxMask",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/TextBox",
"XamlCodeFile": "TextBoxMask.bind",
"Icon": "/SamplePages/TextBoxMask/TextBoxMask.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/TextBoxMask.md"
@ -1157,7 +1121,7 @@
"Name": "Mouse",
"Type": "MouseCursorPage",
"About": "Mouse.Cursor attached property enables you to easily change the mouse cursor over specific Framework elements.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/Mouse",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Extensions/FrameworkElement/FrameworkElementExtensions.Mouse.cs",
"XamlCodeFile": "MouseCursorPage.bind",
"Icon": "/SamplePages/Mouse/MouseCursor.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/MouseCursor.md"
@ -1166,7 +1130,7 @@
"Name": "TextBoxRegex",
"Type": "TextBoxRegexPage",
"About": "TextBoxRegex helps developer to validate a TextBox with a regular expression using the Regex property.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/TextBoxRegEx",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/TextBox",
"XamlCodeFile": "TextBoxRegex.bind",
"Icon": "/SamplePages/TextBoxRegex/TextBoxRegex.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/TextBoxRegex.md"
@ -1174,7 +1138,7 @@
{
"Name": "SurfaceDialTextbox",
"About": "Enables support for Surface Dial on any given Textbox. Rotate the Dial to change the numeric value of the Textbox.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/SurfaceDialTextbox",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Extensions/TextBox/TextBoxExtensions.SurfaceDial.cs",
"XamlCodeFile": "/SamplePages/SurfaceDialTextbox/SurfaceDialTextboxCode.bind",
"Icon": "/SamplePages/SurfaceDialTextbox/SurfaceDialTextbox.png",
"BadgeUpdateVersionRequired": "Anniversary Update required",
@ -1184,7 +1148,7 @@
"Name": "Visual Extensions",
"Type": "VisualExtensionsPage",
"About": "Attached properties to modify object visual properties through XAML",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/Visual",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Extensions/VisualExtensions.cs",
"XamlCodeFile": "VisualExtensionsCode.bind",
"Icon": "/SamplePages/Visual Extensions/VisualExtensions.png",
"BadgeUpdateVersionRequired": "Creators Update required",
@ -1203,7 +1167,7 @@
"Name": "ClipToBounds",
"Type": "ClipToBoundsPage",
"About": "Extension to clip the UIElement inner controls inside its bounds.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/UIElement",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Extensions/UIElementExtensions.cs",
"XamlCodeFile": "ClipToBoundsCode.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/UIElementExtensions.md"
@ -1212,7 +1176,7 @@
"Name": "StringExtensions",
"Type": "StringExtensionsPage",
"About": "String Extensions to validate strings",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit/Extensions",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit/Extensions/StringExtensions.cs",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/StringExtensions.md"
},
@ -1230,6 +1194,7 @@
"Name": "OnDevice",
"Type": "OnDevicePage",
"About": "The OnDevice markup extension allows you to customize UI appearance on a per-DeviceFamily basis.",
"CodeUrl" : "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Extensions/Markup/OnDeviceExtension.cs",
"Icon": "/SamplePages/OnDevice/OnDevice.png",
"XamlCodeFile": "OnDeviceXaml.bind",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/OnDeviceMarkup.md"
@ -1238,18 +1203,20 @@
"Name": "IconExtensions",
"Type": "IconExtensionsPage",
"About": "Markup extensions to easily create various types of icons.",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/Markup/FontIconExtension",
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/Markup",
"XamlCodeFile": "IconExtensionsXaml.bind",
"Icon": "/Assets/Helpers.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/IconExtensions.md"
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/IconMarkupExtensions.md"
},
{
"Name": "EnumValuesExtension",
"Type": "EnumValuesExtensionPage",
"About": "The EnumValuesExtension markup extension allows you to easily retrieve a collection of all values from an enum type.",
"CodeUrl" : "https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.UI/Extensions/Markup/EnumValuesExtension.cs",
"Icon": "/Assets/Helpers.png",
"XamlCodeFile": "EnumValuesExtensionXaml.bind",
"CodeFile": "EnumValuesExtensionCode.bind"
"CodeFile": "EnumValuesExtensionCode.bind",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/EnumValuesExtension.md"
}
]
},
@ -1263,6 +1230,7 @@
"About": "Demonstrate the properties and events of the Gaze Interaction library",
"XamlCodeFile": "GazeInteractionXaml.bind",
"CodeFile": "GazeInteractionCode.bind",
"CodeUrl" : "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.Input.GazeInteraction",
"Icon": "/SamplePages/GazeInteraction/GazeInteraction.png",
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/gaze/GazeInteractionLibrary.md",
"ApiCheck": "Windows.Devices.Input.Preview.GazeInputSourcePreview"
@ -1275,7 +1243,8 @@
"XamlCodeFile": "GazeTracingXaml.bind",
"CodeFile": "GazeTracingCode.bind",
"Icon": "/SamplePages/GazeTracing/GazeTracing.png",
"ApiCheck": "Windows.Devices.Input.Preview.GazeInputSourcePreview"
"ApiCheck": "Windows.Devices.Input.Preview.GazeInputSourcePreview",
"DocumentationUrl" : "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/gaze/GazeInteractionLibrary.md"
}
]
}

Просмотреть файл

@ -124,15 +124,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
private void NavView_ItemInvoked(Microsoft.UI.Xaml.Controls.NavigationView sender, Microsoft.UI.Xaml.Controls.NavigationViewItemInvokedEventArgs args)
{
//// Temp Workaround for WinUI Bug https://github.com/microsoft/microsoft-ui-xaml/issues/2520
var invokedItem = args.InvokedItem;
if (invokedItem is FrameworkElement fe && fe.DataContext is SampleCategory cat2)
{
invokedItem = cat2;
}
//// End Workaround - args.InvokedItem
if (invokedItem is SampleCategory category)
if (args.InvokedItem is SampleCategory category)
{
if (SamplePickerGrid.Visibility != Visibility.Collapsed && _selectedCategory == category)
{
@ -149,13 +141,16 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
dispatcherQueue.EnqueueAsync(() => SamplePickerGridView.Focus(FocusState.Keyboard));
}
}
else if (args.IsSettingsInvoked)
}
private void SettingsTopNavPaneItem_PointerReleased(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
// Can't get FooterMenuItems to work properly right now with ItemInvoked above, bug?
// For now just hard-code an event.
HideSamplePicker();
if (NavigationFrame.CurrentSourcePageType != typeof(About))
{
HideSamplePicker();
if (NavigationFrame.CurrentSourcePageType != typeof(About))
{
NavigateToSample(null);
}
NavigateToSample(null);
}
}
@ -230,25 +225,29 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
private void ItemContainer_PointerExited(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
var panel = (sender as FrameworkElement).FindDescendant<DropShadowPanel>();
if (panel != null)
if ((sender as FrameworkElement)?.FindDescendant<DropShadowPanel>() is FrameworkElement panel)
{
AnimationBuilder.Create().Opacity(0, duration: TimeSpan.FromMilliseconds(1200)).Start(panel);
AnimationBuilder.Create().Scale(1, duration: TimeSpan.FromMilliseconds(1200)).Start((UIElement)panel.Parent);
if (panel.Parent is UIElement parent)
{
AnimationBuilder.Create().Scale(1, duration: TimeSpan.FromMilliseconds(1200)).Start(parent);
}
}
}
private void ItemContainer_PointerEntered(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse)
if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse &&
(sender as FrameworkElement)?.FindDescendant<DropShadowPanel>() is FrameworkElement panel)
{
var panel = (sender as FrameworkElement).FindDescendant<DropShadowPanel>();
if (panel != null)
{
panel.Visibility = Visibility.Visible;
panel.Visibility = Visibility.Visible;
AnimationBuilder.Create().Opacity(1, duration: TimeSpan.FromMilliseconds(600)).Start(panel);
AnimationBuilder.Create().Scale(1.1, duration: TimeSpan.FromMilliseconds(600)).Start((UIElement)panel.Parent);
AnimationBuilder.Create().Opacity(1, duration: TimeSpan.FromMilliseconds(600)).Start(panel);
if (panel.Parent is UIElement parent)
{
AnimationBuilder.Create().Scale(1.1, duration: TimeSpan.FromMilliseconds(600)).Start(parent);
}
}
}

Просмотреть файл

@ -4,10 +4,10 @@
xmlns:animations="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:media="using:Microsoft.Toolkit.Uwp.UI.Media"
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
xmlns:winui="using:Microsoft.UI.Xaml.Controls"
ui:TitleBarExtensions.BackgroundColor="{StaticResource Brand-Color}"
ui:TitleBarExtensions.ButtonBackgroundColor="{StaticResource Brand-Color}"
@ -29,13 +29,12 @@
</Page.Resources>
<Grid>
<winui:NavigationView x:Name="NavView"
IsSettingsVisible="True"
IsSettingsVisible="False"
ItemInvoked="NavView_ItemInvoked"
MenuItemTemplate="{StaticResource CategoryTemplate}"
PaneDisplayMode="Top"
SelectionFollowsFocus="Disabled"
Style="{StaticResource ToolkitNavViewStyle}">
<winui:NavigationView.PaneFooter>
SelectionFollowsFocus="Disabled">
<winui:NavigationView.AutoSuggestBox>
<AutoSuggestBox x:Name="SearchBox"
MinWidth="150"
VerticalAlignment="Center"
@ -43,6 +42,13 @@
QueryIcon="Find"
QuerySubmitted="SearchBox_QuerySubmitted"
TextChanged="SearchBox_TextChanged" />
</winui:NavigationView.AutoSuggestBox>
<winui:NavigationView.PaneFooter>
<!-- Not sure why we can't get to display properly with FooterMenuItems -->
<winui:NavigationViewItem x:Name="SettingsTopNavPaneItem"
Icon="Home"
PointerReleased="SettingsTopNavPaneItem_PointerReleased"
Style="{ThemeResource MUX_NavigationViewSettingsItemStyleWhenOnTopPane}" />
</winui:NavigationView.PaneFooter>
<Grid>
<winui:ParallaxView x:Name="Parallax"

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,8 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.Styles">
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.Styles">
<!-- https://github.com/logos -->
<!-- https://github.com/logos -->
<x:String x:Key="GithubIcon">M21.7999992370605,0L19.220495223999,0.26007080078125 16.81787109375,1.00595712661743 14.6436157226563,2.18616962432861 12.7492189407349,3.74921894073486 11.1861696243286,5.64361572265625 10.0059566497803,7.81787109375 9.26007080078125,10.2204961776733 9,12.8000001907349 9.65248012542725,16.8459720611572 11.4694375991821,20.3591785430908 14.2401514053345,23.1291217803955 17.7539005279541,24.9453010559082 18.4305686950684,24.8080005645752 18.6273498535156,24.3296756744385 18.6207065582275,23.4247951507568 18.609375,21.9468746185303 16.4340572357178,22.0373229980469 15.1187467575073,21.4822216033936 14.4708204269409,20.7821025848389 14.2976503372192,20.4375 13.8297338485718,19.5214366912842 13.3685493469238,18.947265625 12.8765497207642,18.5656261444092 12.3995819091797,18.1091804504395 12.4844465255737,17.87890625 12.7874250411987,17.7974605560303 12.9647998809814,17.7875003814697 13.8134965896606,18.0311241149902 14.4276065826416,18.4802703857422 14.8007507324219,18.9127178192139 14.926549911499,19.1062507629395 15.8880548477173,20.1437015533447 16.9443283081055,20.494140625 17.9229640960693,20.416259765625 18.6515502929688,20.1687507629395 18.9645938873291,19.1242198944092 19.4640502929688,18.4593753814697 17.3543262481689,18.0241260528564 15.4833002090454,17.014066696167 14.1450357437134,15.1450166702271 13.6336002349854,12.1328001022339 13.9853601455688,10.2268438339233 14.9500007629395,8.69764995574951 14.7027282714844,7.54188776016235 14.7441072463989,6.53565359115601 15.0765495300293,5.30859994888306 15.2825078964233,5.28076791763306 15.9191312789917,5.34375619888306 17.0145378112793,5.71729135513306 18.596851348877,6.62109994888306 21.799976348877,6.19062519073486 25.004674911499,6.62265014648438 26.5845413208008,5.71818733215332 27.6791000366211,5.34472513198853 28.315746307373,5.28210020065308 28.5218753814697,5.31015014648438 28.8556652069092,6.53784370422363 28.8976573944092,7.5438346862793 28.6499996185303,8.69764995574951 29.6154251098633,10.2268533706665 29.9656257629395,12.1328001022339 29.453296661377,15.1497011184692 28.1123065948486,17.0164012908936 26.2366523742676,18.020601272583 24.120325088501,18.4500007629395 24.7275562286377,19.3355484008789 24.9890747070313,20.8187503814697 24.9804744720459,23.0584030151367 24.9718742370605,24.3312511444092 25.1693305969238,24.8128852844238 25.8531246185303,24.9453010559082 29.3641395568848,23.1273632049561 32.1326217651367,20.3568344116211 33.948070526123,16.8442134857178 34.5999984741211,12.8000001907349 34.3399276733398,10.2204961776733 33.5940399169922,7.81787109375 32.4138298034668,5.64361572265625 30.8507804870605,3.74921894073486 28.9563827514648,2.18616962432861 26.7821273803711,1.00595712661743 24.3795032501221,0.26007080078125 21.7999992370605,0z</x:String>
</ResourceDictionary>

Просмотреть файл

@ -4,7 +4,8 @@
<!-- Branding -->
<Color x:Key="Brand-Color">#3750D1</Color>
<SolidColorBrush x:Key="Brush-Brand-Color" Color="{StaticResource Brand-Color}" />
<SolidColorBrush x:Key="Brush-Brand-Color"
Color="{StaticResource Brand-Color}" />
<!-- Colors -->
<Color x:Key="White">#FFFFFFFF</Color>
@ -12,15 +13,16 @@
<Color x:Key="Blue-01">#FF0078D7</Color>
<Color x:Key="Red">#FFFF0000</Color>
<!-- Titlebar -->
<!-- Titlebar -->
<Color x:Key="Titlebar-Foreground">#FFDDDDDD</Color>
<SolidColorBrush x:Key="Brush-Red" Color="{StaticResource Red}" />
<SolidColorBrush x:Key="Brush-Red"
Color="{StaticResource Red}" />
<!-- Brushes -->
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<!-- Colors -->
<!-- Colors -->
<Color x:Key="Color-Main">White</Color>
<Color x:Key="Color-Alt">Black</Color>
<Color x:Key="Grey-01">#FF333333</Color>
@ -30,32 +32,32 @@
<Color x:Key="Grey-05">#FFF0F0F0</Color>
<Color x:Key="SampleInfo-Background">#FFEEEEEE</Color>
<!-- Branding Colors -->
<!-- Branding Colors -->
<SolidColorBrush x:Key="SystemControlHighlightAccentBrush"
Color="{StaticResource Brand-Color}" />
Color="{StaticResource Brand-Color}" />
<SolidColorBrush x:Key="Brush-Link-Normal"
Color="#CC191919" />
<!-- UI Elements -->
Color="#CC191919" />
<!-- UI Elements -->
<SolidColorBrush x:Key="SliderThumbBackground"
Color="Black" />
<SolidColorBrush x:Key="Brush-Grey-01"
Color="{ThemeResource Grey-01}" />
Color="{ThemeResource Grey-01}" />
<SolidColorBrush x:Key="Brush-Grey-02"
Color="{ThemeResource Grey-02}" />
Color="{ThemeResource Grey-02}" />
<SolidColorBrush x:Key="Brush-Grey-03"
Color="{ThemeResource Grey-03}" />
Color="{ThemeResource Grey-03}" />
<SolidColorBrush x:Key="Brush-Grey-04"
Color="{ThemeResource Grey-04}" />
Color="{ThemeResource Grey-04}" />
<SolidColorBrush x:Key="Brush-Grey-05"
Color="{ThemeResource Grey-05}" />
Color="{ThemeResource Grey-05}" />
<SolidColorBrush x:Key="Brush-Main"
Color="{StaticResource White}" />
Color="{StaticResource White}" />
<SolidColorBrush x:Key="Brush-Alt"
Color="Black" />
Color="Black" />
<SolidColorBrush x:Key="Brush-Sample-Background"
Color="White" />
<SolidColorBrush x:Key="Brush-Blue-01"
Color="{StaticResource Blue-01}" />
Color="{StaticResource Blue-01}" />
<SolidColorBrush x:Key="Border-AboutPage-Horizontal"
Color="#33000000" />
<SolidColorBrush x:Key="Border-AboutPage-Vertical"
@ -93,11 +95,13 @@
<SolidColorBrush x:Key="Brush-Sample-TransparentHeader"
Color="#AA000000" />
<SolidColorBrush x:Key="SampleMarkdownBackgroundBrush" Color="#FFF6F8FA" />
<SolidColorBrush x:Key="SampleMarkdownInlineCodeBackgroundBrush" Color="#FFC2C4C6" />
<SolidColorBrush x:Key="SampleMarkdownBackgroundBrush"
Color="#FFF6F8FA" />
<SolidColorBrush x:Key="SampleMarkdownInlineCodeBackgroundBrush"
Color="#FFC2C4C6" />
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<!-- Colors -->
<!-- Colors -->
<Color x:Key="Color-Main">Black</Color>
<Color x:Key="Color-Alt">White</Color>
<Color x:Key="Grey-01">#FFF0F0F0</Color>
@ -107,32 +111,32 @@
<Color x:Key="Grey-05">#FF333333</Color>
<Color x:Key="SampleInfo-Background">#FF222222</Color>
<!-- Branding Colors -->
<!-- Branding Colors -->
<SolidColorBrush x:Key="SystemControlHighlightAccentBrush"
Color="{StaticResource Brand-Color}" />
Color="{StaticResource Brand-Color}" />
<SolidColorBrush x:Key="Brush-Link-Normal"
Color="#CCFFFFFF" />
<!-- UI Elements -->
Color="#CCFFFFFF" />
<!-- UI Elements -->
<SolidColorBrush x:Key="SliderThumbBackground"
Color="White" />
<SolidColorBrush x:Key="Brush-Grey-01"
Color="{ThemeResource Grey-01}" />
Color="{ThemeResource Grey-01}" />
<SolidColorBrush x:Key="Brush-Grey-02"
Color="{ThemeResource Grey-02}" />
Color="{ThemeResource Grey-02}" />
<SolidColorBrush x:Key="Brush-Grey-03"
Color="{ThemeResource Grey-03}" />
Color="{ThemeResource Grey-03}" />
<SolidColorBrush x:Key="Brush-Grey-04"
Color="{ThemeResource Grey-04}" />
Color="{ThemeResource Grey-04}" />
<SolidColorBrush x:Key="Brush-Grey-05"
Color="{ThemeResource Grey-05}" />
Color="{ThemeResource Grey-05}" />
<SolidColorBrush x:Key="Brush-Main"
Color="{StaticResource Black}" />
Color="{StaticResource Black}" />
<SolidColorBrush x:Key="Brush-Alt"
Color="White" />
Color="White" />
<SolidColorBrush x:Key="Brush-Sample-Background"
Color="{ThemeResource Grey-05}" />
<SolidColorBrush x:Key="Brush-Blue-01"
Color="{StaticResource Blue-01}" />
Color="{StaticResource Blue-01}" />
<SolidColorBrush x:Key="Border-AboutPage-Horizontal"
Color="#33FFFFFF" />
<SolidColorBrush x:Key="Border-AboutPage-Vertical"
@ -170,8 +174,10 @@
<SolidColorBrush x:Key="Brush-Sample-TransparentHeader"
Color="#66FFFFFF" />
<SolidColorBrush x:Key="SampleMarkdownBackgroundBrush" Color="#FF171717" />
<SolidColorBrush x:Key="SampleMarkdownInlineCodeBackgroundBrush" Color="#FF404040" />
<SolidColorBrush x:Key="SampleMarkdownBackgroundBrush"
Color="#FF171717" />
<SolidColorBrush x:Key="SampleMarkdownInlineCodeBackgroundBrush"
Color="#FF404040" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>

Просмотреть файл

@ -1,6 +1,6 @@
{
"new-section-title": "What's New",
"new-samples": [ "TokenizingTextBox", "PipelineBrush", "WrapLayout", "IsNullOrEmptyStateTrigger", "High Performance APIs" ],
"new-samples": [ "MVVM Toolkit", "EffectAnimations", "TabbedCommandBar", "ColorPicker", "ColorPickerButton", "SwitchPresenter" ],
"resources": [
{
"title": "Toolkit",
@ -28,6 +28,10 @@
{
"title": "UWP Community Discord",
"url": "https://discord.gg/zBA5aCn"
},
{
"title": "Contribution Wiki",
"url": "https://aka.ms/wct/wiki"
}
]
},
@ -82,11 +86,11 @@
"links": [
{
"title": "Version",
"url": "http://aka.ms/uwptoolkit"
"url": "http://aka.ms/windowstoolkit"
},
{
"title": "ColorCode-Universal (Dependency)",
"url": "https://github.com/WilliamABradley/ColorCode-Universal"
"url": "https://github.com/windows-toolkit/ColorCode-Universal"
},
{
"title": "Monaco Editor UWP (Dependency)",

Просмотреть файл

@ -25,6 +25,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -35,10 +36,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
AddCompositionAnimationFactory(Properties.Composition.AnchorPoint(axis), (float)to, (float?)from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(Properties.Composition.AnchorPoint(axis), (float)to, (float?)from, delay, duration, repeat, easingType, easingMode);
return this;
}
@ -50,6 +52,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting point for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -59,10 +62,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector2? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
AddCompositionAnimationFactory(nameof(Visual.AnchorPoint), to, from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(nameof(Visual.AnchorPoint), to, from, delay, duration, repeat, easingType, easingMode);
return this;
}
@ -74,6 +78,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -83,17 +88,18 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
{
if (layer == FrameworkLayer.Composition)
{
AddCompositionAnimationFactory(nameof(Visual.Opacity), (float)to, (float?)from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(nameof(Visual.Opacity), (float)to, (float?)from, delay, duration, repeat, easingType, easingMode);
}
else
{
AddXamlAnimationFactory(nameof(UIElement.Opacity), to, from, delay, duration, easingType, easingMode);
AddXamlAnimationFactory(nameof(UIElement.Opacity), to, from, delay, duration, repeat, easingType, easingMode);
}
return this;
@ -107,6 +113,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -117,17 +124,18 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
{
if (layer == FrameworkLayer.Composition)
{
AddCompositionAnimationFactory(Properties.Composition.Translation(axis), (float)to, (float?)from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(Properties.Composition.Translation(axis), (float)to, (float?)from, delay, duration, repeat, easingType, easingMode);
}
else
{
AddXamlAnimationFactory(Properties.Xaml.Translation(axis), to, from, delay, duration, easingType, easingMode);
AddXamlAnimationFactory(Properties.Xaml.Translation(axis), to, from, delay, duration, repeat, easingType, easingMode);
}
return this;
@ -140,6 +148,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting point for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -149,18 +158,19 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector2? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
{
if (layer == FrameworkLayer.Composition)
{
AddCompositionAnimationFactory(Properties.Composition.TranslationXY(), to, from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(Properties.Composition.TranslationXY(), to, from, delay, duration, repeat, easingType, easingMode);
}
else
{
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.TranslateX), to.X, from?.X, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.TranslateY), to.Y, from?.Y, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.TranslateX), to.X, from?.X, delay, duration, repeat, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.TranslateY), to.Y, from?.Y, delay, duration, repeat, easingType, easingMode);
}
return this;
@ -173,6 +183,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting point for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -182,10 +193,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector3? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
return AddCompositionAnimationFactory(Properties.Composition.Translation(), to, from, delay, duration, easingType, easingMode);
return AddCompositionAnimationFactory(Properties.Composition.Translation(), to, from, delay, duration, repeat, easingType, easingMode);
}
/// <summary>
@ -196,6 +208,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -206,10 +219,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
return AddCompositionAnimationFactory(Properties.Composition.Offset(axis), (float)to, (float?)from, delay, duration, easingType, easingMode);
return AddCompositionAnimationFactory(Properties.Composition.Offset(axis), (float)to, (float?)from, delay, duration, repeat, easingType, easingMode);
}
/// <summary>
@ -219,6 +233,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting point for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -228,10 +243,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector2? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
AddCompositionAnimationFactory(Properties.Composition.OffsetXY(), to, from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(Properties.Composition.OffsetXY(), to, from, delay, duration, repeat, easingType, easingMode);
return this;
}
@ -243,6 +259,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting point for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -252,10 +269,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector3? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
return AddCompositionAnimationFactory(nameof(Visual.Offset), to, from, delay, duration, easingType, easingMode);
return AddCompositionAnimationFactory(nameof(Visual.Offset), to, from, delay, duration, repeat, easingType, easingMode);
}
/// <summary>
@ -265,6 +283,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -274,6 +293,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
@ -283,12 +303,12 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector3? from3 = from is null ? null : new((float)(double)from);
Vector3 to3 = new((float)to);
AddCompositionAnimationFactory(nameof(Visual.Scale), to3, from3, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(nameof(Visual.Scale), to3, from3, delay, duration, repeat, easingType, easingMode);
}
else
{
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.ScaleX), to, from, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.ScaleY), to, from, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.ScaleX), to, from, delay, duration, repeat, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.ScaleY), to, from, delay, duration, repeat, easingType, easingMode);
}
return this;
@ -302,6 +322,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -312,17 +333,18 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
{
if (layer == FrameworkLayer.Composition)
{
AddCompositionAnimationFactory(Properties.Composition.Scale(axis), (float)to, (float?)from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(Properties.Composition.Scale(axis), (float)to, (float?)from, delay, duration, repeat, easingType, easingMode);
}
else
{
AddXamlTransformDoubleAnimationFactory(Properties.Xaml.Scale(axis), to, from, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(Properties.Xaml.Scale(axis), to, from, delay, duration, repeat, easingType, easingMode);
}
return this;
@ -335,6 +357,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting point for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -344,18 +367,19 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector2? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
{
if (layer == FrameworkLayer.Composition)
{
AddCompositionAnimationFactory(Properties.Composition.ScaleXY(), to, from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(Properties.Composition.ScaleXY(), to, from, delay, duration, repeat, easingType, easingMode);
}
else
{
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.ScaleX), to.X, from?.X, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.ScaleY), to.Y, from?.Y, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.ScaleX), to.X, from?.X, delay, duration, repeat, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.ScaleY), to.Y, from?.Y, delay, duration, repeat, easingType, easingMode);
}
return this;
@ -368,6 +392,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting point for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -377,10 +402,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector3? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
return AddCompositionAnimationFactory(nameof(Visual.Scale), to, from, delay, duration, easingType, easingMode);
return AddCompositionAnimationFactory(nameof(Visual.Scale), to, from, delay, duration, repeat, easingType, easingMode);
}
/// <summary>
@ -391,6 +417,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -401,17 +428,18 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
{
if (layer == FrameworkLayer.Composition)
{
AddCompositionAnimationFactory(Properties.Composition.CenterPoint(axis), (float)to, (float?)from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(Properties.Composition.CenterPoint(axis), (float)to, (float?)from, delay, duration, repeat, easingType, easingMode);
}
else
{
AddXamlTransformDoubleAnimationFactory(Properties.Xaml.CenterPoint(axis), to, from, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(Properties.Xaml.CenterPoint(axis), to, from, delay, duration, repeat, easingType, easingMode);
}
return this;
@ -424,6 +452,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting point for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -433,18 +462,19 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector2? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
{
if (layer == FrameworkLayer.Composition)
{
AddCompositionAnimationFactory(Properties.Composition.CenterPointXY(), to, from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(Properties.Composition.CenterPointXY(), to, from, delay, duration, repeat, easingType, easingMode);
}
else
{
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.CenterX), to.X, from?.X, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.CenterY), to.Y, from?.Y, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.CenterX), to.X, from?.X, delay, duration, repeat, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.CenterY), to.Y, from?.Y, delay, duration, repeat, easingType, easingMode);
}
return this;
@ -457,6 +487,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting point for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -466,10 +497,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector3? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
return AddCompositionAnimationFactory(nameof(Visual.CenterPoint), to, from, delay, duration, easingType, easingMode);
return AddCompositionAnimationFactory(nameof(Visual.CenterPoint), to, from, delay, duration, repeat, easingType, easingMode);
}
/// <summary>
@ -479,6 +511,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -488,20 +521,21 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
{
if (layer == FrameworkLayer.Composition)
{
AddCompositionAnimationFactory(nameof(Visual.RotationAngle), (float)to, (float?)from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(nameof(Visual.RotationAngle), (float)to, (float?)from, delay, duration, repeat, easingType, easingMode);
}
else
{
double? fromDegrees = from * Math.PI / 180;
double toDegrees = to * Math.PI / 180;
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.Rotation), toDegrees, fromDegrees, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.Rotation), toDegrees, fromDegrees, delay, duration, repeat, easingType, easingMode);
}
return this;
@ -514,6 +548,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -523,17 +558,18 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
{
if (layer == FrameworkLayer.Composition)
{
AddCompositionAnimationFactory(nameof(Visual.RotationAngleInDegrees), (float)to, (float?)from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(nameof(Visual.RotationAngleInDegrees), (float)to, (float?)from, delay, duration, repeat, easingType, easingMode);
}
else
{
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.Rotation), to, from, delay, duration, easingType, easingMode);
AddXamlTransformDoubleAnimationFactory(nameof(CompositeTransform.Rotation), to, from, delay, duration, repeat, easingType, easingMode);
}
return this;
@ -546,6 +582,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -555,10 +592,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector3? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
return AddCompositionAnimationFactory(nameof(Visual.RotationAxis), to, from, delay, duration, easingType, easingMode);
return AddCompositionAnimationFactory(nameof(Visual.RotationAxis), to, from, delay, duration, repeat, easingType, easingMode);
}
/// <summary>
@ -568,6 +606,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -577,10 +616,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Quaternion? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
return AddCompositionAnimationFactory(nameof(Visual.Orientation), to, from, delay, duration, easingType, easingMode);
return AddCompositionAnimationFactory(nameof(Visual.Orientation), to, from, delay, duration, repeat, easingType, easingMode);
}
/// <summary>
@ -590,6 +630,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -599,6 +640,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Matrix4x4? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
@ -623,9 +665,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
fromTranslation = translation3;
}
Scale(toScale, fromScale, delay, duration, easingType, easingMode);
Orientation(toRotation, fromRotation, delay, duration, easingType, easingMode);
Translation(toTranslation, fromTranslation, delay, duration, easingType, easingMode);
Scale(toScale, fromScale, delay, duration, repeat, easingType, easingMode);
Orientation(toRotation, fromRotation, delay, duration, repeat, easingType, easingMode);
Translation(toTranslation, fromTranslation, delay, duration, repeat, easingType, easingMode);
return this;
@ -641,6 +683,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -651,6 +694,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
@ -660,6 +704,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
(float?)from,
delay ?? DefaultDelay,
duration ?? DefaultDuration,
repeat ?? RepeatOption.Once,
easingType,
easingMode);
@ -675,6 +720,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -684,6 +730,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Thickness? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode)
{
@ -693,6 +740,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
(float?)from?.Left,
delay ?? DefaultDelay,
duration ?? DefaultDuration,
repeat ?? RepeatOption.Once,
easingType,
easingMode));
@ -702,6 +750,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
(float?)from?.Top,
delay ?? DefaultDelay,
duration ?? DefaultDuration,
repeat ?? RepeatOption.Once,
easingType,
easingMode));
@ -711,6 +760,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
(float?)from?.Right,
delay ?? DefaultDelay,
duration ?? DefaultDuration,
repeat ?? RepeatOption.Once,
easingType,
easingMode));
@ -720,6 +770,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
(float?)from?.Bottom,
delay ?? DefaultDelay,
duration ?? DefaultDuration,
repeat ?? RepeatOption.Once,
easingType,
easingMode));
@ -734,6 +785,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -744,17 +796,18 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
{
if (layer == FrameworkLayer.Composition)
{
AddCompositionAnimationFactory(Properties.Composition.Size(axis), (float)to, (float?)from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(Properties.Composition.Size(axis), (float)to, (float?)from, delay, duration, repeat, easingType, easingMode);
}
else
{
AddXamlAnimationFactory(Properties.Xaml.Size(axis), to, from, delay, duration, easingType, easingMode);
AddXamlAnimationFactory(Properties.Xaml.Size(axis), to, from, delay, duration, repeat, easingType, easingMode);
}
return this;
@ -767,6 +820,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="from">The optional starting point for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode (defaults to once).</param>
/// <param name="easingType">The optional easing function type for the animation.</param>
/// <param name="easingMode">The optional easing function mode for the animation.</param>
/// <param name="layer">The target framework layer to animate.</param>
@ -776,18 +830,19 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Vector2? from = null,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null,
EasingType easingType = DefaultEasingType,
EasingMode easingMode = DefaultEasingMode,
FrameworkLayer layer = FrameworkLayer.Composition)
{
if (layer == FrameworkLayer.Composition)
{
AddCompositionAnimationFactory(Properties.Composition.Size(), to, from, delay, duration, easingType, easingMode);
AddCompositionAnimationFactory(Properties.Composition.Size(), to, from, delay, duration, repeat, easingType, easingMode);
}
else
{
AddXamlAnimationFactory(nameof(FrameworkElement.Width), to.X, from?.X, delay, duration, easingType, easingMode);
AddXamlAnimationFactory(nameof(FrameworkElement.Height), to.Y, from?.Y, delay, duration, easingType, easingMode);
AddXamlAnimationFactory(nameof(FrameworkElement.Width), to.X, from?.X, delay, duration, repeat, easingType, easingMode);
AddXamlAnimationFactory(nameof(FrameworkElement.Height), to.Y, from?.Y, delay, duration, repeat, easingType, easingMode);
}
return this;

Просмотреть файл

@ -61,6 +61,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
T? From,
TimeSpan Delay,
TimeSpan Duration,
RepeatOption Repeat,
EasingType EasingType,
EasingMode EasingMode)
: ICompositionAnimationFactory, IXamlAnimationFactory
@ -70,6 +71,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
public CompositionAnimation GetAnimation(CompositionObject targetHint, out CompositionObject? target)
{
CompositionEasingFunction? easingFunction = targetHint.Compositor.TryCreateEasingFunction(EasingType, EasingMode);
(AnimationIterationBehavior iterationBehavior, int iterationCount) = Repeat.ToBehaviorAndCount();
target = null;
@ -80,7 +82,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
GetToAs<bool>(),
GetFromAs<bool>(),
Delay,
Duration);
Duration,
iterationBehavior: iterationBehavior,
iterationCount: iterationCount);
}
if (typeof(T) == typeof(float))
@ -91,7 +95,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
GetFromAs<float>(),
Delay,
Duration,
easingFunction);
easingFunction,
iterationBehavior: iterationBehavior,
iterationCount: iterationCount);
}
if (typeof(T) == typeof(double))
@ -102,7 +108,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
(float?)GetFromAs<double>(),
Delay,
Duration,
easingFunction);
easingFunction,
iterationBehavior: iterationBehavior,
iterationCount: iterationCount);
}
if (typeof(T) == typeof(Vector2))
@ -113,7 +121,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
GetFromAs<Vector2>(),
Delay,
Duration,
easingFunction);
easingFunction,
iterationBehavior: iterationBehavior,
iterationCount: iterationCount);
}
if (typeof(T) == typeof(Vector3))
@ -124,7 +134,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
GetFromAs<Vector3>(),
Delay,
Duration,
easingFunction);
easingFunction,
iterationBehavior: iterationBehavior,
iterationCount: iterationCount);
}
if (typeof(T) == typeof(Vector4))
@ -135,7 +147,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
GetFromAs<Vector4>(),
Delay,
Duration,
easingFunction);
easingFunction,
iterationBehavior: iterationBehavior,
iterationCount: iterationCount);
}
if (typeof(T) == typeof(Color))
@ -146,7 +160,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
GetFromAs<Color>(),
Delay,
Duration,
easingFunction);
easingFunction,
iterationBehavior: iterationBehavior,
iterationCount: iterationCount);
}
if (typeof(T) == typeof(Quaternion))
@ -157,7 +173,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
GetFromAs<Quaternion>(),
Delay,
Duration,
easingFunction);
easingFunction,
iterationBehavior: iterationBehavior,
iterationCount: iterationCount);
}
throw new InvalidOperationException("Invalid animation type");
@ -177,6 +195,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Delay,
Duration,
easingFunction,
Repeat.ToRepeatBehavior(),
enableDependecyAnimations: true);
}
@ -189,6 +208,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Delay,
Duration,
easingFunction,
Repeat.ToRepeatBehavior(),
enableDependecyAnimations: true);
}
@ -201,6 +221,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Delay,
Duration,
easingFunction,
Repeat.ToRepeatBehavior(),
enableDependecyAnimations: true);
}
@ -212,7 +233,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
GetFromAs<Color>(),
Delay,
Duration,
easingFunction);
easingFunction,
Repeat.ToRepeatBehavior());
}
throw new InvalidOperationException("Invalid animation type");
@ -287,6 +309,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
float? From,
TimeSpan Delay,
TimeSpan Duration,
RepeatOption Repeat,
EasingType EasingType,
EasingMode EasingMode)
: ICompositionAnimationFactory
@ -297,7 +320,16 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Visual visual = (Visual)targetHint;
InsetClip clip = visual.Clip as InsetClip ?? (InsetClip)(visual.Clip = visual.Compositor.CreateInsetClip());
CompositionEasingFunction? easingFunction = clip.Compositor.TryCreateEasingFunction(EasingType, EasingMode);
ScalarKeyFrameAnimation animation = clip.Compositor.CreateScalarKeyFrameAnimation(Property, To, From, Delay, Duration, easingFunction);
(AnimationIterationBehavior iterationBehavior, int iterationCount) = Repeat.ToBehaviorAndCount();
ScalarKeyFrameAnimation animation = clip.Compositor.CreateScalarKeyFrameAnimation(
Property,
To,
From,
Delay,
Duration,
easingFunction,
iterationBehavior: iterationBehavior,
iterationCount: iterationCount);
target = clip;
@ -314,6 +346,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? From,
TimeSpan Delay,
TimeSpan Duration,
RepeatOption Repeat,
EasingType EasingType,
EasingMode EasingMode)
: IXamlAnimationFactory
@ -328,7 +361,14 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
element.RenderTransform = transform = new CompositeTransform();
}
return transform.CreateDoubleAnimation(Property, To, From, Duration, Delay, EasingType.ToEasingFunction(EasingMode));
return transform.CreateDoubleAnimation(
Property,
To,
From,
Duration,
Delay,
EasingType.ToEasingFunction(EasingMode),
Repeat.ToRepeatBehavior());
}
}

Просмотреть файл

@ -236,6 +236,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The animation duration.</param>
/// <param name="repeatOption">The repeat option for the animation (defaults to one iteration).</param>
/// <param name="delayBehavior">The delay behavior to use (ignored if <paramref name="layer"/> is <see cref="FrameworkLayer.Xaml"/>).</param>
/// <param name="layer">The target framework layer to animate.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
public AnimationBuilder NormalizedKeyFrames<T>(
@ -244,6 +245,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeatOption = null,
AnimationDelayBehavior? delayBehavior = null,
FrameworkLayer layer = FrameworkLayer.Composition)
where T : unmanaged
{
@ -253,7 +255,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
property,
delay,
duration ?? DefaultDuration,
repeatOption ?? RepeatOption.Once);
repeatOption ?? RepeatOption.Once,
delayBehavior ?? DefaultDelayBehavior);
build(builder);
@ -286,6 +289,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The animation duration.</param>
/// <param name="repeatOption">The repeat option for the animation (defaults to one iteration).</param>
/// <param name="delayBehavior">The delay behavior to use (ignored if <paramref name="layer"/> is <see cref="FrameworkLayer.Xaml"/>).</param>
/// <param name="layer">The target framework layer to animate.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
public AnimationBuilder NormalizedKeyFrames<T, TState>(
@ -295,6 +299,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeatOption = null,
AnimationDelayBehavior? delayBehavior = null,
FrameworkLayer layer = FrameworkLayer.Composition)
where T : unmanaged
{
@ -304,7 +309,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
property,
delay,
duration ?? DefaultDuration,
repeatOption ?? RepeatOption.Once);
repeatOption ?? RepeatOption.Once,
delayBehavior ?? DefaultDelayBehavior);
build(builder, state);
@ -334,6 +340,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="build">The callback to use to construct the custom animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="repeat">The repeat option for the animation (defaults to one iteration).</param>
/// <param name="delayBehavior">The delay behavior to use (ignored if <paramref name="layer"/> is <see cref="FrameworkLayer.Xaml"/>).</param>
/// <param name="layer">The target framework layer to animate.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
public AnimationBuilder TimedKeyFrames<T>(
@ -341,12 +348,17 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Action<ITimedKeyFrameAnimationBuilder<T>> build,
TimeSpan? delay = null,
RepeatOption? repeat = null,
AnimationDelayBehavior? delayBehavior = null,
FrameworkLayer layer = FrameworkLayer.Composition)
where T : unmanaged
{
if (layer == FrameworkLayer.Composition)
{
TimedKeyFrameAnimationBuilder<T>.Composition builder = new(property, delay, repeat ?? RepeatOption.Once);
TimedKeyFrameAnimationBuilder<T>.Composition builder = new(
property,
delay,
repeat ?? RepeatOption.Once,
delayBehavior ?? DefaultDelayBehavior);
build(builder);
@ -374,6 +386,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="build">The callback to use to construct the custom animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="repeatOption">The repeat option for the animation (defaults to one iteration).</param>
/// <param name="delayBehavior">The delay behavior to use (ignored if <paramref name="layer"/> is <see cref="FrameworkLayer.Xaml"/>).</param>
/// <param name="layer">The target framework layer to animate.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
public AnimationBuilder TimedKeyFrames<T, TState>(
@ -382,12 +395,17 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Action<ITimedKeyFrameAnimationBuilder<T>, TState> build,
TimeSpan? delay = null,
RepeatOption? repeatOption = null,
AnimationDelayBehavior? delayBehavior = null,
FrameworkLayer layer = FrameworkLayer.Composition)
where T : unmanaged
{
if (layer == FrameworkLayer.Composition)
{
TimedKeyFrameAnimationBuilder<T>.Composition builder = new(property, delay, repeatOption ?? RepeatOption.Once);
TimedKeyFrameAnimationBuilder<T>.Composition builder = new(
property,
delay,
repeatOption ?? RepeatOption.Once,
delayBehavior ?? DefaultDelayBehavior);
build(builder, state);

Просмотреть файл

@ -32,9 +32,10 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Action<INormalizedKeyFrameAnimationBuilder<T>> build,
TimeSpan? delay,
TimeSpan? duration,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? delayBehavior)
{
return Builder.NormalizedKeyFrames(Property, build, delay, duration, repeatOption, Layer);
return Builder.NormalizedKeyFrames(Property, build, delay, duration, repeatOption, delayBehavior, Layer);
}
/// <inheritdoc/>
@ -43,18 +44,20 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Action<INormalizedKeyFrameAnimationBuilder<T>, TState> build,
TimeSpan? delay,
TimeSpan? duration,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? delayBehavior)
{
return Builder.NormalizedKeyFrames(Property, state, build, delay, duration, repeatOption, Layer);
return Builder.NormalizedKeyFrames(Property, state, build, delay, duration, repeatOption, delayBehavior, Layer);
}
/// <inheritdoc/>
public AnimationBuilder TimedKeyFrames(
Action<ITimedKeyFrameAnimationBuilder<T>> build,
TimeSpan? delay,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? delayBehavior)
{
return Builder.TimedKeyFrames(Property, build, delay, repeatOption, Layer);
return Builder.TimedKeyFrames(Property, build, delay, repeatOption, delayBehavior, Layer);
}
/// <inheritdoc/>
@ -62,9 +65,10 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
TState state,
Action<ITimedKeyFrameAnimationBuilder<T>, TState> build,
TimeSpan? delay,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? delayBehavior)
{
return Builder.TimedKeyFrames(Property, state, build, delay, repeatOption, Layer);
return Builder.TimedKeyFrames(Property, state, build, delay, repeatOption, delayBehavior, Layer);
}
}
@ -81,13 +85,15 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Action<INormalizedKeyFrameAnimationBuilder<double>> build,
TimeSpan? delay,
TimeSpan? duration,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? delayBehavior)
{
NormalizedKeyFrameAnimationBuilder<double>.Composition builder = new(
Property,
delay,
duration ?? DefaultDuration,
repeatOption ?? RepeatOption.Once);
repeatOption ?? RepeatOption.Once,
delayBehavior ?? DefaultDelayBehavior);
build(builder);
@ -102,13 +108,15 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Action<INormalizedKeyFrameAnimationBuilder<double>, TState> build,
TimeSpan? delay,
TimeSpan? duration,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? delayBehavior)
{
NormalizedKeyFrameAnimationBuilder<double>.Composition builder = new(
Property,
delay,
duration ?? DefaultDuration,
repeatOption ?? RepeatOption.Once);
repeatOption ?? RepeatOption.Once,
delayBehavior ?? DefaultDelayBehavior);
build(builder, state);
@ -121,9 +129,14 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
public AnimationBuilder TimedKeyFrames(
Action<ITimedKeyFrameAnimationBuilder<double>> build,
TimeSpan? delay,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? delayBehavior)
{
TimedKeyFrameAnimationBuilder<double>.Composition builder = new(Property, delay, repeatOption ?? RepeatOption.Once);
TimedKeyFrameAnimationBuilder<double>.Composition builder = new(
Property,
delay,
repeatOption ?? RepeatOption.Once,
delayBehavior ?? DefaultDelayBehavior);
build(builder);
@ -137,9 +150,14 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
TState state,
Action<ITimedKeyFrameAnimationBuilder<double>, TState> build,
TimeSpan? delay,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? delayBehavior)
{
TimedKeyFrameAnimationBuilder<double>.Composition builder = new(Property, delay, repeatOption ?? RepeatOption.Once);
TimedKeyFrameAnimationBuilder<double>.Composition builder = new(
Property,
delay,
repeatOption ?? RepeatOption.Once,
delayBehavior ?? DefaultDelayBehavior);
build(builder, state);
@ -180,7 +198,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Action<INormalizedKeyFrameAnimationBuilder<double>> build,
TimeSpan? delay,
TimeSpan? duration,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? _)
{
NormalizedKeyFrameAnimationBuilder<double>.Xaml builder = new(
Property,
@ -201,7 +220,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
Action<INormalizedKeyFrameAnimationBuilder<double>, TState> build,
TimeSpan? delay,
TimeSpan? duration,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? _)
{
NormalizedKeyFrameAnimationBuilder<double>.Xaml builder = new(
Property,
@ -220,7 +240,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
public AnimationBuilder TimedKeyFrames(
Action<ITimedKeyFrameAnimationBuilder<double>> build,
TimeSpan? delay,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? _)
{
TimedKeyFrameAnimationBuilder<double>.Xaml builder = new(Property, delay, repeatOption ?? RepeatOption.Once);
@ -236,7 +257,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
TState state,
Action<ITimedKeyFrameAnimationBuilder<double>, TState> build,
TimeSpan? delay,
RepeatOption? repeatOption)
RepeatOption? repeatOption,
AnimationDelayBehavior? _)
{
TimedKeyFrameAnimationBuilder<double>.Xaml builder = new(Property, delay, repeatOption ?? RepeatOption.Once);

Просмотреть файл

@ -32,7 +32,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="to">The final value for the animation.</param>
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The animation duration.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat option for the animation.</param>
/// <param name="easingType">The easing function for the animation.</param>
/// <param name="easingMode">The easing mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -42,6 +43,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
T? from,
TimeSpan? delay,
TimeSpan? duration,
RepeatOption? repeat,
EasingType easingType,
EasingMode easingMode)
where T : unmanaged
@ -52,6 +54,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
from,
delay ?? DefaultDelay,
duration ?? DefaultDuration,
repeat ?? RepeatOption.Once,
easingType,
easingMode);
@ -68,7 +71,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="to">The final value for the animation.</param>
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The animation duration.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode for the animation.</param>
/// <param name="easingType">The easing function for the animation.</param>
/// <param name="easingMode">The easing mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -78,6 +82,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
T? from,
TimeSpan? delay,
TimeSpan? duration,
RepeatOption? repeat,
EasingType easingType,
EasingMode easingMode)
where T : unmanaged
@ -88,6 +93,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
from,
delay ?? DefaultDelay,
duration ?? DefaultDuration,
repeat ?? RepeatOption.Once,
easingType,
easingMode);
@ -103,7 +109,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="to">The final value for the animation.</param>
/// <param name="from">The optional starting value for the animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The animation duration.</param>
/// <param name="duration">The optional animation duration.</param>
/// <param name="repeat">The optional repeat mode for the animation.</param>
/// <param name="easingType">The easing function for the animation.</param>
/// <param name="easingMode">The easing mode for the animation.</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
@ -113,6 +120,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
double? from,
TimeSpan? delay,
TimeSpan? duration,
RepeatOption? repeat,
EasingType easingType,
EasingMode easingMode)
{
@ -122,6 +130,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
from,
delay ?? DefaultDelay,
duration ?? DefaultDuration,
repeat ?? RepeatOption.Once,
easingType,
easingMode);

Просмотреть файл

@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System;
using Windows.UI.Composition;
namespace Microsoft.Toolkit.Uwp.UI.Animations
{
@ -19,12 +20,14 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The animation duration.</param>
/// <param name="repeat">The repeat option for the animation (defaults to one iteration).</param>
/// <param name="delayBehavior">The delay behavior to use (ignored if the animation is not being executed on the composition layer).</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
AnimationBuilder NormalizedKeyFrames(
Action<INormalizedKeyFrameAnimationBuilder<T>> build,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null);
RepeatOption? repeat = null,
AnimationDelayBehavior? delayBehavior = null);
/// <summary>
/// Adds a custom animation based on normalized keyframes ot the current schedule.
@ -35,13 +38,15 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The animation duration.</param>
/// <param name="repeat">The repeat option for the animation (defaults to one iteration).</param>
/// <param name="delayBehavior">The delay behavior to use (ignored if the animation is not being executed on the composition layer).</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
AnimationBuilder NormalizedKeyFrames<TState>(
TState state,
Action<INormalizedKeyFrameAnimationBuilder<T>, TState> build,
TimeSpan? delay = null,
TimeSpan? duration = null,
RepeatOption? repeat = null);
RepeatOption? repeat = null,
AnimationDelayBehavior? delayBehavior = null);
/// <summary>
/// Adds a custom animation based on timed keyframes to the current schedule.
@ -49,11 +54,13 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="build">The callback to use to construct the custom animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="repeat">The repeat option for the animation (defaults to one iteration).</param>
/// <param name="delayBehavior">The delay behavior to use (ignored if the animation is not being executed on the composition layer).</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
AnimationBuilder TimedKeyFrames(
Action<ITimedKeyFrameAnimationBuilder<T>> build,
TimeSpan? delay = null,
RepeatOption? repeat = null);
RepeatOption? repeat = null,
AnimationDelayBehavior? delayBehavior = null);
/// <summary>
/// Adds a custom animation based on timed keyframes to the current schedule.
@ -63,11 +70,13 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="build">The callback to use to construct the custom animation.</param>
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="repeat">The repeat option for the animation (defaults to one iteration).</param>
/// <param name="delayBehavior">The delay behavior to use (ignored if the animation is not being executed on the composition layer).</param>
/// <returns>The current <see cref="AnimationBuilder"/> instance.</returns>
AnimationBuilder TimedKeyFrames<TState>(
TState state,
Action<ITimedKeyFrameAnimationBuilder<T>, TState> build,
TimeSpan? delay = null,
RepeatOption? repeat = null);
RepeatOption? repeat = null,
AnimationDelayBehavior? delayBehavior = null);
}
}

Просмотреть файл

@ -24,6 +24,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <param name="delay">The optional initial delay for the animation.</param>
/// <param name="duration">The animation duration.</param>
/// <param name="repeat">The <see cref="RepeatOption"/> value for the animation</param>
/// <param name="delayBehavior">The delay behavior mode to use.</param>
/// <param name="keyFrames">The list of keyframes to use to build the animation.</param>
/// <returns>A <see cref="CompositionAnimation"/> instance with the specified animation.</returns>
public static CompositionAnimation GetAnimation<TKeyFrame>(
@ -32,6 +33,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
TimeSpan? delay,
TimeSpan duration,
RepeatOption repeat,
AnimationDelayBehavior delayBehavior,
ArraySegment<TKeyFrame> keyFrames)
where TKeyFrame : struct, IKeyFrameInfo
{
@ -237,6 +239,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
if (delay.HasValue)
{
animation.DelayBehavior = delayBehavior;
animation.DelayTime = delay!.Value;
}
@ -251,13 +254,23 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// </summary>
public sealed class Composition : NormalizedKeyFrameAnimationBuilder<T>, AnimationBuilder.ICompositionAnimationFactory
{
/// <summary>
/// The target delay behavior to use.
/// </summary>
private readonly AnimationDelayBehavior delayBehavior;
/// <summary>
/// Initializes a new instance of the <see cref="NormalizedKeyFrameAnimationBuilder{T}.Composition"/> class.
/// </summary>
/// <inheritdoc cref="NormalizedKeyFrameAnimationBuilder{T}"/>
public Composition(string property, TimeSpan? delay, TimeSpan duration, RepeatOption repeat)
/// <param name="property">The target property to animate.</param>
/// <param name="delay">The target delay for the animation.</param>
/// <param name="duration">The target duration for the animation.</param>
/// <param name="repeat">The repeat options for the animation.</param>
/// <param name="delayBehavior">The delay behavior mode to use.</param>
public Composition(string property, TimeSpan? delay, TimeSpan duration, RepeatOption repeat, AnimationDelayBehavior delayBehavior)
: base(property, delay, duration, repeat)
{
this.delayBehavior = delayBehavior;
}
/// <inheritdoc/>
@ -283,6 +296,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
this.delay,
this.duration,
this.repeat,
this.delayBehavior,
this.keyFrames.GetArraySegment());
}
}

Просмотреть файл

@ -20,7 +20,10 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// <summary>
/// Initializes a new instance of the <see cref="NormalizedKeyFrameAnimationBuilder{T}.Xaml"/> class.
/// </summary>
/// <inheritdoc cref="NormalizedKeyFrameAnimationBuilder{T}"/>
/// <param name="property">The target property to animate.</param>
/// <param name="delay">The target delay for the animation.</param>
/// <param name="duration">The target duration for the animation.</param>
/// <param name="repeat">The repeat options for the animation.</param>
public Xaml(string property, TimeSpan? delay, TimeSpan duration, RepeatOption repeat)
: base(property, delay, duration, repeat)
{

Просмотреть файл

@ -19,13 +19,22 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// </summary>
public sealed class Composition : TimedKeyFrameAnimationBuilder<T>, AnimationBuilder.ICompositionAnimationFactory
{
/// <summary>
/// The target delay behavior to use.
/// </summary>
private readonly AnimationDelayBehavior delayBehavior;
/// <summary>
/// Initializes a new instance of the <see cref="TimedKeyFrameAnimationBuilder{T}.Composition"/> class.
/// </summary>
/// <inheritdoc cref="TimedKeyFrameAnimationBuilder{T}"/>
public Composition(string property, TimeSpan? delay, RepeatOption repeat)
/// <param name="property">The target property to animate.</param>
/// <param name="delay">The target delay for the animation.</param>
/// <param name="repeat">The repeat options for the animation.</param>
/// <param name="delayBehavior">The delay behavior mode to use.</param>
public Composition(string property, TimeSpan? delay, RepeatOption repeat, AnimationDelayBehavior delayBehavior)
: base(property, delay, repeat)
{
this.delayBehavior = delayBehavior;
}
/// <inheritdoc/>
@ -56,6 +65,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
this.delay,
duration,
this.repeat,
this.delayBehavior,
keyFrames);
}
}

Просмотреть файл

@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Animation;
@ -149,17 +150,19 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
listAnimProperty.ListViewBase.ScrollIntoView(parameter);
// give time to the UI thread to scroll the list
var t = listAnimProperty.ListViewBase.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
{
try
var dispatcherQueue = DispatcherQueue.GetForCurrentThread();
var t = dispatcherQueue.EnqueueAsync(
async () =>
{
var success = await listAnimProperty.ListViewBase.TryStartConnectedAnimationAsync(connectedAnimation, parameter, listAnimProperty.ElementName);
}
catch (Exception)
{
connectedAnimation.Cancel();
}
});
try
{
var success = await listAnimProperty.ListViewBase.TryStartConnectedAnimationAsync(connectedAnimation, parameter, listAnimProperty.ElementName);
}
catch (Exception)
{
connectedAnimation.Cancel();
}
}, DispatcherQueuePriority.Normal);
animationHandled = true;
}

Просмотреть файл

@ -38,6 +38,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
/// </summary>
public const EasingMode DefaultEasingMode = EasingMode.EaseInOut;
/// <summary>
/// The default <see cref="AnimationDelayBehavior"/> value used for animations (only applies to composition animations).
/// </summary>
public const AnimationDelayBehavior DefaultDelayBehavior = AnimationDelayBehavior.SetInitialValueBeforeDelay;
/// <summary>
/// The reusable mapping of control points for easing curves for combinations of <see cref="EasingType"/> and <see cref="EasingMode"/> values.
/// </summary>

Просмотреть файл

@ -23,7 +23,14 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
{
TaskCompletionSource<object?> taskCompletionSource = new TaskCompletionSource<object?>();
storyboard.Completed += (_, _) => taskCompletionSource.SetResult(null);
void OnCompleted(object sender, object e)
{
((Storyboard)sender).Completed -= OnCompleted;
taskCompletionSource.SetResult(null);
}
storyboard.Completed += OnCompleted;
storyboard.Begin();

Просмотреть файл

@ -19,7 +19,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI\Microsoft.Toolkit.Uwp.UI.csproj" />
</ItemGroup>

Просмотреть файл

@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System;
using Windows.UI.Composition;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media.Animation;
@ -103,6 +104,26 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
typeof(Animation),
new PropertyMetadata(RepeatOption.Once));
/// <summary>
/// Gets or sets the delay behavior for the animation. The default value is set to <see cref="AnimationDelayBehavior.SetInitialValueBeforeDelay"/>.
/// This value is applicable when the current animation is used as either an implicit composition animation, or an explicit composition animation.
/// If the current animation is instead running on the XAML layer (if used through <see cref="CustomAnimation{TValue, TKeyFrame}"/>), it will be ignored.
/// </summary>
public AnimationDelayBehavior DelayBehavior
{
get => (AnimationDelayBehavior)GetValue(DelayBehaviorProperty);
set => SetValue(DelayBehaviorProperty, value);
}
/// <summary>
/// Identifies the <seealso cref="DelayBehavior"/> dependency property.
/// </summary>
public static readonly DependencyProperty DelayBehaviorProperty = DependencyProperty.Register(
nameof(DelayBehavior),
typeof(AnimationDelayBehavior),
typeof(Animation),
new PropertyMetadata(AnimationDelayBehavior.SetInitialValueBeforeDelay));
/// <inheritdoc/>
public abstract AnimationBuilder AppendToBuilder(AnimationBuilder builder, TimeSpan? delayHint, TimeSpan? durationHint, EasingType? easingTypeHint, EasingMode? easingModeHint);
}

Просмотреть файл

@ -104,6 +104,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
delay: Delay ?? delayHint ?? DefaultDelay,
duration: Duration ?? durationHint ?? DefaultDuration,
repeatOption: Repeat,
delayBehavior: DelayBehavior,
build: static (b, s) => s.This.AppendToBuilder(b, s.EasingTypeHint, s.EasingModeHint));
}

Просмотреть файл

@ -42,6 +42,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
state: (this, easingTypeHint, easingModeHint),
delay: Delay ?? delayHint ?? DefaultDelay,
duration: Duration ?? durationHint ?? DefaultDuration,
delayBehavior: DelayBehavior,
layer: Layer,
build: static (b, s) => s.This.AppendToBuilder(b, s.EasingTypeHint, s.EasingModeHint));
}

Просмотреть файл

@ -29,7 +29,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
ExplicitTarget,
Delay ?? DefaultDelay,
Duration ?? DefaultDuration,
Repeat);
Repeat,
DelayBehavior);
var (to, from) = GetParsedValues();

Просмотреть файл

@ -25,6 +25,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Animations
From,
Delay ?? delayHint,
Duration ?? durationHint,
Repeat,
EasingType ?? easingTypeHint ?? DefaultEasingType,
EasingMode ?? easingModeHint ?? DefaultEasingMode);
}

Просмотреть файл

@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Markup;
@ -39,7 +40,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Behaviors
typeof(FocusBehavior),
new PropertyMetadata(TimeSpan.FromMilliseconds(100)));
private DispatcherTimer _timer;
private DispatcherQueueTimer _timer;
/// <summary>
/// Initializes a new instance of the <see cref="FocusBehavior"/> class.
@ -120,10 +121,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Behaviors
// This allows us to handle the case where the controls are not loaded in the order we expect.
if (_timer is null)
{
_timer = new DispatcherTimer
{
Interval = FocusEngagementTimeout,
};
_timer = DispatcherQueue.GetForCurrentThread().CreateTimer();
_timer.Interval = FocusEngagementTimeout;
_timer.Tick += OnEngagementTimerTick;
_timer.Start();
}

Просмотреть файл

@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Controls;
@ -20,12 +21,13 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
[TemplatePart(Name = ContentPresenterPart, Type = typeof(ContentPresenter))]
public partial class InAppNotification : ContentControl
{
private InAppNotificationDismissKind _lastDismissKind;
private DispatcherTimer _dismissTimer = new DispatcherTimer();
private Button _dismissButton;
private VisualStateGroup _visualStateGroup;
private ContentPresenter _contentProvider;
private List<NotificationOptions> _stackedNotificationOptions = new List<NotificationOptions>();
private DispatcherQueueTimer _dismissTimer;
private Button _dismissButton;
private DispatcherQueue _dispatcherQueue;
private InAppNotificationDismissKind _lastDismissKind;
private List<NotificationOptions> _stackedNotificationOptions;
private VisualStateGroup _visualStateGroup;
/// <summary>
/// Initializes a new instance of the <see cref="InAppNotification"/> class.
@ -34,7 +36,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{
DefaultStyleKey = typeof(InAppNotification);
_dispatcherQueue = DispatcherQueue.GetForCurrentThread();
_dismissTimer = _dispatcherQueue.CreateTimer();
_dismissTimer.Tick += DismissTimer_Tick;
_stackedNotificationOptions = new List<NotificationOptions>();
}
/// <inheritdoc />
@ -160,16 +166,17 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
/// <summary>
/// Dismiss the notification
/// </summary>
public void Dismiss()
public void Dismiss(bool dismissAll = false)
{
Dismiss(InAppNotificationDismissKind.Programmatic);
Dismiss(InAppNotificationDismissKind.Programmatic, dismissAll);
}
/// <summary>
/// Dismiss the notification
/// </summary>
/// <param name="dismissKind">Kind of action that triggered dismiss event</param>
private void Dismiss(InAppNotificationDismissKind dismissKind)
/// <param name="dismissAll">Indicates if one or all notifications should be dismissed.</param>
private void Dismiss(InAppNotificationDismissKind dismissKind, bool dismissAll = false)
{
if (_stackedNotificationOptions.Count == 0)
{
@ -179,8 +186,17 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
_dismissTimer.Stop();
// Dismiss all if requested
if (dismissAll)
{
_stackedNotificationOptions.Clear();
}
else
{
_stackedNotificationOptions.RemoveAt(0);
}
// Continue to display notification if on remaining stacked notification
_stackedNotificationOptions.RemoveAt(0);
if (_stackedNotificationOptions.Any())
{
var notificationOptions = _stackedNotificationOptions[0];
@ -238,8 +254,16 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
_contentProvider.Content = element;
break;
case DataTemplate dataTemplate:
_contentProvider.ContentTemplate = dataTemplate;
_contentProvider.Content = null;
// Without this check, the dataTemplate will fail to render.
// Why? Setting the ContentTemplate causes the control to re-evaluate it's Content value.
// When we set the ContentTemplate to the same instance of itself, we aren't actually changing the value.
// This means that the Content value won't be re-evaluated and stay null, causing the render to fail.
if (_contentProvider.ContentTemplate != dataTemplate)
{
_contentProvider.ContentTemplate = dataTemplate;
_contentProvider.Content = null;
}
break;
case object content:
_contentProvider.ContentTemplate = ContentTemplate;

Просмотреть файл

@ -33,6 +33,10 @@
<None Include="$(OutDir)\Design\$(MSBuildProjectName).Design*.dll;$(OutDir)\Design\$(MSBuildProjectName).Design*.pdb" Pack="true" PackagePath="lib\$(TargetFramework)\Design" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.UI.Xaml" Version="2.5.0" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Strings\en-us\Resources.resw" />
</ItemGroup>

Просмотреть файл

@ -6,6 +6,7 @@ using System;
using System.Collections;
using System.Collections.Specialized;
using Microsoft.Toolkit.Uwp.Helpers;
using Windows.System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
@ -32,7 +33,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private static readonly Random Randomizer = new Random();
private int _currentIndex = -1; // current index in the items displayed
private DispatcherTimer _timer; // timer for triggering when to flip the content
private DispatcherQueueTimer _timer; // timer for triggering when to flip the content
private FrameworkElement _currentElement; // FrameworkElement holding a reference to the current element being display
private FrameworkElement _nextElement; // FrameworkElement holding a reference to the next element being display
private FrameworkElement _scroller; // Container Element that's being translated to animate from one item to the next
@ -387,7 +388,8 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
if (_timer == null)
{
_timer = new DispatcherTimer() { Interval = GetTileDuration() };
_timer = DispatcherQueue.GetForCurrentThread().CreateTimer();
_timer.Interval = GetTileDuration();
_timer.Tick += Timer_Tick;
}

Просмотреть файл

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls">
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:Windows10version1903="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 8)">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///Microsoft.Toolkit.Uwp.UI.Controls.Core/TabbedCommandBar/TabbedCommandBarItem.xaml" />
@ -88,7 +89,7 @@
Visibility="{Binding TemplateSettings.OverflowButtonVisibility, RelativeSource={RelativeSource Mode=TemplatedParent}}">
<Button.Flyout>
<Flyout Placement="Bottom"
ShouldConstrainToRootBounds="False">
Windows10version1903:ShouldConstrainToRootBounds="False">
<Flyout.FlyoutPresenterStyle>
<Style TargetType="FlyoutPresenter">
<Setter Property="Padding" Value="0,8" />

Просмотреть файл

@ -9,6 +9,7 @@ using System.Numerics;
using System.Threading;
using System.Threading.Tasks;
using Windows.Foundation;
using Windows.System;
using Windows.UI.Composition;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@ -39,7 +40,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private Size _imageSize = Size.Empty;
private DispatcherTimer _timerAnimation;
private DispatcherQueueTimer _timerAnimation;
/// <summary>
/// A ScrollViewer used for synchronized the move of the <see cref="TileControl"/>
@ -173,9 +174,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
var loadCompletedSource = new TaskCompletionSource<bool>();
_brushVisual = compositor.CreateSurfaceBrush(_imageSurface);
_imageSurface.LoadCompleted += (s, e) =>
void LoadCompleted(LoadedImageSurface sender, LoadedImageSourceLoadCompletedEventArgs args)
{
if (e.Status == LoadedImageSourceLoadStatus.Success)
sender.LoadCompleted -= LoadCompleted;
if (args.Status == LoadedImageSourceLoadStatus.Success)
{
loadCompletedSource.SetResult(true);
}
@ -183,7 +186,9 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{
loadCompletedSource.SetException(new ArgumentException("Image loading failed."));
}
};
}
_imageSurface.LoadCompleted += LoadCompleted;
await loadCompletedSource.Task;
_imageSize = _imageSurface.DecodedPhysicalSize;
@ -605,7 +610,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{
if (_timerAnimation == null)
{
_timerAnimation = new DispatcherTimer();
_timerAnimation = DispatcherQueue.GetForCurrentThread().CreateTimer();
}
else
{

Просмотреть файл

@ -171,7 +171,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private DataGridRow _focusedRow;
private FrameworkElement _frozenColumnScrollBarSpacer;
private bool _hasNoIndicatorStateStoryboardCompletedHandler;
private DispatcherTimer _hideScrollBarsTimer;
private DispatcherQueueTimer _hideScrollBarsTimer;
// the sum of the widths in pixels of the scrolling columns preceding
// the first displayed scrolling column
@ -6423,19 +6423,19 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
{
if (!_keepScrollBarsShowing)
{
DispatcherTimer hideScrollBarsTimer = null;
DispatcherQueueTimer hideScrollBarsTimer = null;
if (_hideScrollBarsTimer != null)
{
hideScrollBarsTimer = _hideScrollBarsTimer;
if (hideScrollBarsTimer.IsEnabled)
if (hideScrollBarsTimer.IsRunning)
{
hideScrollBarsTimer.Stop();
}
}
else
{
hideScrollBarsTimer = new DispatcherTimer();
hideScrollBarsTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();
hideScrollBarsTimer.Interval = TimeSpan.FromMilliseconds(DATAGRID_noScrollBarCountdownMs);
hideScrollBarsTimer.Tick += HideScrollBarsTimerTick;
_hideScrollBarsTimer = hideScrollBarsTimer;
@ -7958,6 +7958,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
int editingRowSlot = this.EditingRow.Slot;
InvalidateMeasure();
// TODO: Move to DispatcherQueue when FEATURE_VALIDATION_SUMMARY is enabled
this.Dispatcher.BeginInvoke(() =>
{
// It's possible that the DataContext or ItemsSource has changed by the time we reach this code,
@ -8207,7 +8208,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
}
else
{
if (_hideScrollBarsTimer != null && _hideScrollBarsTimer.IsEnabled)
if (_hideScrollBarsTimer != null && _hideScrollBarsTimer.IsRunning)
{
_hideScrollBarsTimer.Stop();
_hideScrollBarsTimer.Start();
@ -8289,7 +8290,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private void StopHideScrollBarsTimer()
{
if (_hideScrollBarsTimer != null && _hideScrollBarsTimer.IsEnabled)
if (_hideScrollBarsTimer != null && _hideScrollBarsTimer.IsRunning)
{
_hideScrollBarsTimer.Stop();
}
@ -8762,6 +8763,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
// If the number of errors has changed, then the ValidationSummary will be a different size,
// and we need to delay our call to ScrollSlotIntoView
this.InvalidateMeasure();
// TODO: Move to DispatcherQueue when FEATURE_VALIDATION_SUMMARY is enabled
this.Dispatcher.BeginInvoke(() =>
{
// It's possible that the DataContext or ItemsSource has changed by the time we reach this code,

Просмотреть файл

@ -17,6 +17,10 @@
<None Include="$(OutDir)\Design\$(MSBuildProjectName).Design*.dll;$(OutDir)\Design\$(MSBuildProjectName).Design*.pdb" Pack="true" PackagePath="lib\$(TargetFramework)\Design" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.UI.Xaml" Version="2.5.0" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>

Просмотреть файл

@ -8,6 +8,7 @@ using System.Collections.Specialized;
using System.Globalization;
using Microsoft.Toolkit.Uwp.Helpers;
using Microsoft.Toolkit.Uwp.UI.Controls.ColorPickerConverters;
using Windows.System;
using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@ -74,7 +75,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
private HsvColor? savedHsvColor = null;
private Color? savedHsvColorRgbEquivalent = null;
private Color? updatedRgbColor = null;
private DispatcherTimer dispatcherTimer = null;
private DispatcherQueueTimer dispatcherQueueTimer = null;
private ColorSpectrum ColorSpectrumControl;
private ColorPickerSlider ColorSpectrumAlphaSlider;
@ -134,7 +135,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
this.ConnectCallbacks(true);
this.SetDefaultPalette();
this.StartDispatcherTimer();
this.StartDispatcherQueueTimer();
}
/// <summary>
@ -142,7 +143,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
/// </summary>
~ColorPicker()
{
this.StopDispatcherTimer();
this.StopDispatcherQueueTimer();
this.CustomPaletteColors.CollectionChanged -= CustomPaletteColors_CollectionChanged;
}
@ -1068,29 +1069,27 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
*
***************************************************************************************/
private void StartDispatcherTimer()
private void StartDispatcherQueueTimer()
{
this.dispatcherTimer = new DispatcherTimer()
{
Interval = new TimeSpan(0, 0, 0, 0, ColorUpdateInterval)
};
this.dispatcherTimer.Tick += DispatcherTimer_Tick;
this.dispatcherTimer.Start();
this.dispatcherQueueTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();
this.dispatcherQueueTimer.Interval = new TimeSpan(0, 0, 0, 0, ColorUpdateInterval);
this.dispatcherQueueTimer.Tick += DispatcherQueueTimer_Tick;
this.dispatcherQueueTimer.Start();
return;
}
private void StopDispatcherTimer()
private void StopDispatcherQueueTimer()
{
if (this.dispatcherTimer != null)
if (this.dispatcherQueueTimer != null)
{
this.dispatcherTimer.Stop();
this.dispatcherQueueTimer.Stop();
}
return;
}
private void DispatcherTimer_Tick(object sender, object e)
private void DispatcherQueueTimer_Tick(object sender, object e)
{
if (this.updatedRgbColor != null)
{

Просмотреть файл

@ -30,6 +30,10 @@
<None Include="$(OutDir)\Design\$(MSBuildProjectName).Design*.dll;$(OutDir)\Design\$(MSBuildProjectName).Design*.pdb" Pack="true" PackagePath="lib\$(TargetFramework)\Design" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.UI.Xaml" Version="2.5.0" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Strings\en-us\Resources.resw" />
</ItemGroup>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше