Skip to content

Commit 24391ac

Browse files
committed
Merge branch 'main' into fix/imagecropper-aspect-ratio-not-updating-on-image-load
2 parents c0b2ec5 + fdaef47 commit 24391ac

File tree

12 files changed

+44
-21
lines changed

12 files changed

+44
-21
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/ListDetailsView/ListDetailsView.bind

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
<controls:ListDetailsView BackButtonBehavior="Automatic"
1212
ItemsSource="{Binding Emails}"
1313
NoSelectionContent="Select an item to view"
14-
CompactModeThresholdWidth="720">
14+
CompactModeThresholdWidth="720"
15+
ListPaneWidth="400">
1516
<controls:ListDetailsView.ItemTemplate>
1617
<DataTemplate>
1718
<StackPanel Margin="0,8">

Microsoft.Toolkit.Uwp.UI.Animations/Xaml/Activities/StopAnimationActivity.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public AnimationSet Animation
2929
public static readonly DependencyProperty AnimationProperty = DependencyProperty.Register(
3030
nameof(Animation),
3131
typeof(AnimationSet),
32-
typeof(StartAnimationActivity),
32+
typeof(StopAnimationActivity),
3333
new PropertyMetadata(null));
3434

3535
/// <summary>
@@ -47,7 +47,7 @@ public UIElement TargetObject
4747
public static readonly DependencyProperty TargetObjectProperty = DependencyProperty.Register(
4848
nameof(TargetObject),
4949
typeof(UIElement),
50-
typeof(StartAnimationActivity),
50+
typeof(StopAnimationActivity),
5151
new PropertyMetadata(null));
5252

5353
/// <inheritdoc/>

Microsoft.Toolkit.Uwp.UI.Behaviors/Animations/StartAnimationAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public UIElement TargetObject
4747
public static readonly DependencyProperty TargetObjectProperty = DependencyProperty.Register(
4848
nameof(TargetObject),
4949
typeof(UIElement),
50-
typeof(StartAnimationActivity),
50+
typeof(StartAnimationAction),
5151
new PropertyMetadata(null));
5252

5353
/// <inheritdoc/>

Microsoft.Toolkit.Uwp.UI.Behaviors/Headers/StickyHeaderBehavior.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ protected override bool Uninitialize()
4646
}
4747

4848
/// <summary>
49-
/// The UIElement that will be faded.
49+
/// The UIElement that will be sticky.
5050
/// </summary>
5151
public static readonly DependencyProperty HeaderElementProperty = DependencyProperty.Register(
52-
nameof(HeaderElement), typeof(UIElement), typeof(QuickReturnHeaderBehavior), new PropertyMetadata(null, PropertyChangedCallback));
52+
nameof(HeaderElement), typeof(UIElement), typeof(StickyHeaderBehavior), new PropertyMetadata(null, PropertyChangedCallback));
5353

5454
private ScrollViewer _scrollViewer;
5555
private double _previousVerticalScrollOffset;

Microsoft.Toolkit.Uwp.UI.Controls.Layout/ListDetailsView/ListDetailsView.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,10 @@ protected override void OnItemsChanged(object e)
461461
/// </summary>
462462
private void OnListPaneWidthChanged()
463463
{
464-
_twoPaneView.Pane1Length = new GridLength(ListPaneWidth);
464+
if (_twoPaneView != null)
465+
{
466+
_twoPaneView.Pane1Length = new GridLength(ListPaneWidth);
467+
}
465468
}
466469
}
467470
}

Microsoft.Toolkit.Uwp.UI.Media/Shadows/AttachedCardShadow.cs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@ protected override void SetElementChildVisual(AttachedShadowElementContext conte
293293
else
294294
{
295295
base.SetElementChildVisual(context);
296+
297+
// Reset context.SpriteVisual.Size and RelativeSizeAdjustment to default values
298+
// as they may be changed in the block above.
299+
context.SpriteVisual.Size = Vector2.Zero;
300+
context.SpriteVisual.RelativeSizeAdjustment = Vector2.One;
301+
296302
context.RemoveAndDisposeResource(OpacityMaskVisualSurfaceResourceKey);
297303
context.RemoveAndDisposeResource(OpacityMaskSurfaceBrushResourceKey);
298304
context.RemoveAndDisposeResource(OpacityMaskVisualResourceKey);
@@ -305,25 +311,33 @@ protected internal override void OnSizeChanged(AttachedShadowElementContext cont
305311
{
306312
Vector2 sizeAsVec2 = newSize.ToVector2();
307313

308-
CompositionRoundedRectangleGeometry geometry = context.GetResource(RoundedRectangleGeometryResourceKey);
309-
if (geometry != null)
314+
if (context.TryGetResource(RoundedRectangleGeometryResourceKey, out CompositionRoundedRectangleGeometry geometry))
310315
{
311316
geometry.Size = sizeAsVec2;
312317
}
313318

314-
CompositionVisualSurface visualSurface = context.GetResource(VisualSurfaceResourceKey);
315-
if (geometry != null)
319+
if (context.TryGetResource(VisualSurfaceResourceKey, out CompositionVisualSurface visualSurface))
316320
{
317321
visualSurface.SourceSize = sizeAsVec2;
318322
}
319323

320-
ShapeVisual shapeVisual = context.GetResource(ShapeVisualResourceKey);
321-
if (geometry != null)
324+
if (context.TryGetResource(ShapeVisualResourceKey, out ShapeVisual shapeVisual))
322325
{
323326
shapeVisual.Size = sizeAsVec2;
324327
}
325328

329+
if (context.TryGetResource(OpacityMaskVisualSurfaceResourceKey, out CompositionVisualSurface opacityMaskVisualSurface))
330+
{
331+
opacityMaskVisualSurface.SourceSize = sizeAsVec2 + new Vector2(MaxBlurRadius * 2);
332+
}
333+
334+
if (InnerContentClipMode is InnerContentClipMode.CompositionMaskBrush)
335+
{
336+
context.SpriteVisual.Size = sizeAsVec2;
337+
}
338+
326339
UpdateShadowClip(context);
340+
UpdateVisualOpacityMask(context);
327341

328342
base.OnSizeChanged(context, newSize, previousSize);
329343
}

Microsoft.Toolkit.Uwp.UI/Shadows/AttachedDropShadow.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,11 @@ protected override CompositionBrush GetShadowMask(AttachedShadowElementContext c
290290
// Create a ShapeVisual so that our geometry can be rendered to a visual
291291
var shapeVisual = context.GetResource(ShapeVisualResourceKey) ??
292292
context.AddResource(ShapeVisualResourceKey, context.Compositor.CreateShapeVisual());
293-
shapeVisual.Shapes.Add(shape);
293+
294+
if (!shapeVisual.Shapes.Contains(shape))
295+
{
296+
shapeVisual.Shapes.Add(shape);
297+
}
294298

295299
// Create a CompositionVisualSurface, which renders our ShapeVisual to a texture
296300
var visualSurface = context.GetResource(VisualSurfaceResourceKey) ??
@@ -344,6 +348,7 @@ protected internal override void OnSizeChanged(AttachedShadowElementContext cont
344348
context.SpriteVisual.Offset = context.Element.CoordinatesFrom(CastTo).ToVector3();
345349

346350
UpdateShadowClip(context);
351+
UpdateShadowMask(context);
347352

348353
base.OnSizeChanged(context, newSize, previousSize);
349354
}

UITests/UITests.App/Package.appxmanifest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Package
1+
<Package
22
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
33
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
44
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
@@ -7,7 +7,7 @@
77

88
<Identity
99
Name="3568ebdf-5b6b-4ddd-bb17-462d614ba50f"
10-
Publisher="CN=alzollin"
10+
Publisher="CN=toolkit"
1111
Version="1.0.0.0" />
1212

1313
<mp:PhoneIdentity PhoneProductId="3568ebdf-5b6b-4ddd-bb17-462d614ba50f" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

UITests/UITests.App/UITests.App.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -22,7 +22,7 @@
2222
<GenerateTestArtifacts>True</GenerateTestArtifacts>
2323
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
2424
<PackageCertificateKeyFile>UITests.App.pfx</PackageCertificateKeyFile>
25-
<PackageCertificateThumbprint>A39FFC9A7EDC3BC1F62B1FC6409AD9EDD84E8CF0</PackageCertificateThumbprint>
25+
<PackageCertificateThumbprint>C732A02FD6C4120C84E0559E5ADE1A83D15B41BD</PackageCertificateThumbprint>
2626
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
2727
<GenerateAppxPackageOnBuild>true</GenerateAppxPackageOnBuild>
2828
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
-8 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)