Merge branch 'main' into winui

# Conflicts:
#	Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj
#	Microsoft.Toolkit.Uwp.SampleApp/Properties/AssemblyInfo.cs
This commit is contained in:
Alexandre Zollinger Chohfi 2021-09-23 10:48:34 -07:00
Родитель a66b58b8b4 d775ea406d
Коммит e41be65241
5 изменённых файлов: 24 добавлений и 25 удалений

2
.github/PULL_REQUEST_TEMPLATE.md поставляемый
Просмотреть файл

@ -6,7 +6,7 @@
## Fixes
<!-- Add the relevant issue number after the word "Fixes" mentioned above (for ex: "## Fixes #1234") which will automatically close the issue once the PR is merged. -->
<!-- Add the relevant issue number after the word "Fixes" mentioned above (for ex: `## Fixes #0000`) which will automatically close the issue once the PR is merged. -->
<!-- Add a brief overview here of the feature/bug & fix. -->

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

@ -16,13 +16,13 @@
<DataTemplate>
<StackPanel Margin="0,8">
<TextBlock Text="{Binding From}"
Style="{ThemeResource SubtitleTextBlockStyle}"/>
Style="{StaticResource SubtitleTextBlockStyle}"/>
<TextBlock Text="{Binding Subject}"
Style="{ThemeResource BodyTextBlockStyle}"
Style="{StaticResource BodyTextBlockStyle}"
Foreground="{ThemeResource Brush-Blue-01}"
MaxLines="1"/>
<TextBlock Text="{Binding Body}"
Style="{ThemeResource BodyTextBlockStyle}"
Style="{StaticResource BodyTextBlockStyle}"
Opacity=".6"
MaxLines="1"/>
</StackPanel>
@ -37,17 +37,17 @@
Height="50"
CornerRadius="999"/>
<TextBlock Text="{Binding From}"
Style="{ThemeResource SubtitleTextBlockStyle}"
Style="{StaticResource SubtitleTextBlockStyle}"
RelativePanel.RightOf="FromEllipse"
Margin="12,-6,0,0"/>
<TextBlock x:Name="SubjectLine"
Text="{Binding Subject}"
Style="{ThemeResource BodyTextBlockStyle}"
Style="{StaticResource BodyTextBlockStyle}"
RelativePanel.Below="FromEllipse"
Margin="0,12,0,0"/>
<TextBlock x:Name="Body"
Text="{Binding Body}"
Style="{ThemeResource BodyTextBlockStyle}"
Style="{StaticResource BodyTextBlockStyle}"
TextWrapping="Wrap"
RelativePanel.Below="SubjectLine"
Margin="0,12,0,0"/>

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

@ -1,6 +1,6 @@
{
"new-section-title": "What's New",
"new-samples": [ "MVVM Toolkit", "EffectAnimations", "TabbedCommandBar", "ColorPicker", "ColorPickerButton", "SwitchPresenter" ],
"new-samples": [ "AttachedCardShadow (Win2D)", "Shadow Animations", "RichSuggestBox", "MetadataControl", "ConstrainedBox", "ControlSizeTrigger" ],
"resources": [
{
"title": "Toolkit",

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

@ -54,8 +54,7 @@ namespace CommunityToolkit.WinUI.UI.Animations
{
static AnimationBuilder ThrowArgumentNullException()
{
throw new ArgumentNullException(
"The target shadow cannot be animated at this time.");
throw new ArgumentNullException("The target shadow cannot be animated at this time.");
}
return ThrowArgumentNullException();
@ -63,9 +62,14 @@ namespace CommunityToolkit.WinUI.UI.Animations
if (Target is IAttachedShadow allShadows)
{
// in this case we'll animate all the shadows being used.
// In this case we'll animate all the shadows being used
foreach (var context in allShadows.EnumerateElementContexts()) //// TODO: Find better way!!!
{
if (context.Shadow is not DropShadow shadow)
{
continue;
}
NormalizedKeyFrameAnimationBuilder<TKeyFrame>.Composition keyFrameBuilder = new(
explicitTarget,
Delay ?? delayHint ?? DefaultDelay,
@ -75,25 +79,18 @@ namespace CommunityToolkit.WinUI.UI.Animations
AppendToBuilder(keyFrameBuilder, easingTypeHint, easingModeHint);
CompositionAnimation animation = keyFrameBuilder.GetAnimation(context.Shadow, out _);
CompositionAnimation animation = keyFrameBuilder.GetAnimation(shadow, out _);
builder.ExternalAnimation(context.Shadow, animation);
builder.ExternalAnimation(shadow, animation);
}
return builder;
}
else
else if (Effects.GetShadow((FrameworkElement)parent) is AttachedShadowBase shadowBase &&
shadowBase.GetElementContext((FrameworkElement)parent).Shadow is DropShadow shadow)
{
var shadowBase = Effects.GetShadow(parent as FrameworkElement);
if (shadowBase == null)
{
static AnimationBuilder ThrowArgumentNullException() => throw new ArgumentNullException("The target's shadow is null, make sure to set the Target property to an element with a Shadow");
return ThrowArgumentNullException();
}
var shadow = shadowBase.GetElementContext((FrameworkElement)parent).Shadow;
// In this case, the animation is targeting the single shadow attached to the target element.
// The same checks as before have been performed to ensure that unloading doesn't cause issues.
NormalizedKeyFrameAnimationBuilder<TKeyFrame>.Composition keyFrameBuilder = new(
explicitTarget,
Delay ?? delayHint ?? DefaultDelay,
@ -107,6 +104,8 @@ namespace CommunityToolkit.WinUI.UI.Animations
return builder.ExternalAnimation(shadow, animation);
}
return builder;
}
}
}

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

@ -27,7 +27,7 @@ namespace CommunityToolkit.WinUI.UI
/// <param name="immediate">Determines if the action execute on the leading edge instead of trailing edge.</param>
/// <example>
/// <code>
/// private DispatcherQueueTimer _typeTimer = new DispatcherQueueTimer();
/// private DispatcherQueueTimer _typeTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();
///
/// _typeTimer.Debounce(async () =>
/// {