Skip to content

Commit e41be65

Browse files
committed
Merge branch 'main' into winui
# Conflicts: # Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj # Microsoft.Toolkit.Uwp.SampleApp/Properties/AssemblyInfo.cs
2 parents a66b58b + d775ea4 commit e41be65

File tree

5 files changed

+24
-25
lines changed

5 files changed

+24
-25
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Fixes
88

9-
<!-- 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. -->
9+
<!-- 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. -->
1010

1111
<!-- Add a brief overview here of the feature/bug & fix. -->
1212

CommunityToolkit.WinUI.SampleApp/SamplePages/ListDetailsView/ListDetailsView.bind

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
<DataTemplate>
1717
<StackPanel Margin="0,8">
1818
<TextBlock Text="{Binding From}"
19-
Style="{ThemeResource SubtitleTextBlockStyle}"/>
19+
Style="{StaticResource SubtitleTextBlockStyle}"/>
2020
<TextBlock Text="{Binding Subject}"
21-
Style="{ThemeResource BodyTextBlockStyle}"
21+
Style="{StaticResource BodyTextBlockStyle}"
2222
Foreground="{ThemeResource Brush-Blue-01}"
2323
MaxLines="1"/>
2424
<TextBlock Text="{Binding Body}"
25-
Style="{ThemeResource BodyTextBlockStyle}"
25+
Style="{StaticResource BodyTextBlockStyle}"
2626
Opacity=".6"
2727
MaxLines="1"/>
2828
</StackPanel>
@@ -37,17 +37,17 @@
3737
Height="50"
3838
CornerRadius="999"/>
3939
<TextBlock Text="{Binding From}"
40-
Style="{ThemeResource SubtitleTextBlockStyle}"
40+
Style="{StaticResource SubtitleTextBlockStyle}"
4141
RelativePanel.RightOf="FromEllipse"
4242
Margin="12,-6,0,0"/>
4343
<TextBlock x:Name="SubjectLine"
4444
Text="{Binding Subject}"
45-
Style="{ThemeResource BodyTextBlockStyle}"
45+
Style="{StaticResource BodyTextBlockStyle}"
4646
RelativePanel.Below="FromEllipse"
4747
Margin="0,12,0,0"/>
4848
<TextBlock x:Name="Body"
4949
Text="{Binding Body}"
50-
Style="{ThemeResource BodyTextBlockStyle}"
50+
Style="{StaticResource BodyTextBlockStyle}"
5151
TextWrapping="Wrap"
5252
RelativePanel.Below="SubjectLine"
5353
Margin="0,12,0,0"/>

CommunityToolkit.WinUI.SampleApp/landingPageLinks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"new-section-title": "What's New",
3-
"new-samples": [ "MVVM Toolkit", "EffectAnimations", "TabbedCommandBar", "ColorPicker", "ColorPickerButton", "SwitchPresenter" ],
3+
"new-samples": [ "AttachedCardShadow (Win2D)", "Shadow Animations", "RichSuggestBox", "MetadataControl", "ConstrainedBox", "ControlSizeTrigger" ],
44
"resources": [
55
{
66
"title": "Toolkit",

CommunityToolkit.WinUI.UI.Animations/Xaml/Abstract/ShadowAnimation{TValue,TKeyFrame}.cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,22 @@ public AnimationBuilder AppendToBuilder(AnimationBuilder builder, UIElement pare
5454
{
5555
static AnimationBuilder ThrowArgumentNullException()
5656
{
57-
throw new ArgumentNullException(
58-
"The target shadow cannot be animated at this time.");
57+
throw new ArgumentNullException("The target shadow cannot be animated at this time.");
5958
}
6059

6160
return ThrowArgumentNullException();
6261
}
6362

6463
if (Target is IAttachedShadow allShadows)
6564
{
66-
// in this case we'll animate all the shadows being used.
65+
// In this case we'll animate all the shadows being used
6766
foreach (var context in allShadows.EnumerateElementContexts()) //// TODO: Find better way!!!
6867
{
68+
if (context.Shadow is not DropShadow shadow)
69+
{
70+
continue;
71+
}
72+
6973
NormalizedKeyFrameAnimationBuilder<TKeyFrame>.Composition keyFrameBuilder = new(
7074
explicitTarget,
7175
Delay ?? delayHint ?? DefaultDelay,
@@ -75,25 +79,18 @@ static AnimationBuilder ThrowArgumentNullException()
7579

7680
AppendToBuilder(keyFrameBuilder, easingTypeHint, easingModeHint);
7781

78-
CompositionAnimation animation = keyFrameBuilder.GetAnimation(context.Shadow, out _);
82+
CompositionAnimation animation = keyFrameBuilder.GetAnimation(shadow, out _);
7983

80-
builder.ExternalAnimation(context.Shadow, animation);
84+
builder.ExternalAnimation(shadow, animation);
8185
}
8286

8387
return builder;
8488
}
85-
else
89+
else if (Effects.GetShadow((FrameworkElement)parent) is AttachedShadowBase shadowBase &&
90+
shadowBase.GetElementContext((FrameworkElement)parent).Shadow is DropShadow shadow)
8691
{
87-
var shadowBase = Effects.GetShadow(parent as FrameworkElement);
88-
if (shadowBase == null)
89-
{
90-
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");
91-
92-
return ThrowArgumentNullException();
93-
}
94-
95-
var shadow = shadowBase.GetElementContext((FrameworkElement)parent).Shadow;
96-
92+
// In this case, the animation is targeting the single shadow attached to the target element.
93+
// The same checks as before have been performed to ensure that unloading doesn't cause issues.
9794
NormalizedKeyFrameAnimationBuilder<TKeyFrame>.Composition keyFrameBuilder = new(
9895
explicitTarget,
9996
Delay ?? delayHint ?? DefaultDelay,
@@ -107,6 +104,8 @@ static AnimationBuilder ThrowArgumentNullException()
107104

108105
return builder.ExternalAnimation(shadow, animation);
109106
}
107+
108+
return builder;
110109
}
111110
}
112111
}

CommunityToolkit.WinUI/Extensions/DispatcherQueueTimerExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class DispatcherQueueTimerExtensions
2727
/// <param name="immediate">Determines if the action execute on the leading edge instead of trailing edge.</param>
2828
/// <example>
2929
/// <code>
30-
/// private DispatcherQueueTimer _typeTimer = new DispatcherQueueTimer();
30+
/// private DispatcherQueueTimer _typeTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();
3131
///
3232
/// _typeTimer.Debounce(async () =>
3333
/// {

0 commit comments

Comments
 (0)