diff --git a/Microsoft.Toolkit.Uwp.UI.Controls.Markdown/Render/MarkdownTable.cs b/Microsoft.Toolkit.Uwp.UI.Controls.Markdown/Render/MarkdownTable.cs index b4cab0cd3af..1d77c778e85 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls.Markdown/Render/MarkdownTable.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls.Markdown/Render/MarkdownTable.cs @@ -155,10 +155,7 @@ protected override Size ArrangeOverride(Size finalSize) var columnIndex = Grid.GetColumn(child); var rowIndex = Grid.GetRow(child); - var rect = new Rect(0, 0, 0, 0) - { - X = _borderThickness - }; + var rect = new Rect(_borderThickness, 0, 0, 0); for (int col = 0; col < columnIndex; col++) { diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/Carousel/CarouselPanel.cs b/Microsoft.Toolkit.Uwp.UI.Controls/Carousel/CarouselPanel.cs index 378fe7d4a5e..58d553feed6 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/Carousel/CarouselPanel.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/Carousel/CarouselPanel.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.Toolkit.Uwp.Extensions; using Microsoft.Toolkit.Uwp.UI.Extensions; using Windows.Foundation; using Windows.UI; @@ -283,7 +284,7 @@ protected override Size ArrangeOverride(Size finalSize) double centerLeft = 0; double centerTop = 0; - Clip = new RectangleGeometry { Rect = new Rect(0, 0, finalSize.Width, finalSize.Height) }; + Clip = new RectangleGeometry { Rect = finalSize.ToRect() }; for (int i = 0; i < Children.Count; i++) { diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/Eyedropper/Eyedropper.Logic.cs b/Microsoft.Toolkit.Uwp.UI.Controls/Eyedropper/Eyedropper.Logic.cs index c6c894fe5ea..be6ba99249a 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/Eyedropper/Eyedropper.Logic.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/Eyedropper/Eyedropper.Logic.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.Graphics.Canvas; +using Microsoft.Toolkit.Uwp.Extensions; using Windows.Foundation; using Windows.Graphics.DirectX; using Windows.Graphics.Display; @@ -98,7 +99,7 @@ private void UpdatePreview(int centerX, int centerY) for (var j = colorStartX; j < colorEndX; j++) { var color = colors[((i - colorStartY) * width) + (j - colorStartX)]; - drawingSession.FillRectangle(new Rect(startPoint, size), color); + drawingSession.FillRectangle(startPoint.ToRect(size), color); startPoint.X += PreviewPixelsPerRawPixel; } diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/Eyedropper/EyedropperToolButton.cs b/Microsoft.Toolkit.Uwp.UI.Controls/Eyedropper/EyedropperToolButton.cs index 3e67a6b1436..d0f0cf56370 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/Eyedropper/EyedropperToolButton.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/Eyedropper/EyedropperToolButton.cs @@ -4,6 +4,7 @@ using System; using System.Threading.Tasks; +using Microsoft.Toolkit.Uwp.Extensions; using Windows.Foundation; using Windows.UI.Core; using Windows.UI.Xaml; @@ -216,8 +217,8 @@ private async Task UpdateEyedropperWorkAreaAsync() } var transform = TargetElement.TransformToVisual(content); - var position = transform.TransformPoint(default(Point)); - _eyedropper.WorkArea = new Rect(position, new Size(TargetElement.ActualWidth, TargetElement.ActualHeight)); + var position = transform.TransformPoint(default); + _eyedropper.WorkArea = position.ToRect(TargetElement.ActualWidth, TargetElement.ActualHeight); if (ControlHelpers.IsXamlRootAvailable && XamlRoot != null) { _eyedropper.XamlRoot = XamlRoot; diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Animations.cs b/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Animations.cs index 2ad3c7b3243..2cd4581f6cc 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Animations.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Animations.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Numerics; +using Microsoft.Toolkit.Uwp.Extensions; using Windows.Foundation; using Windows.UI.Composition; using Windows.UI.Xaml; @@ -117,7 +118,7 @@ private static List GetRectKeyframes(Rect from, Rect to, rectKeyframes.Add(new DiscreteObjectKeyFrame { KeyTime = KeyTime.FromTimeSpan(time), - Value = new Rect(startPoint, endPoint) + Value = startPoint.ToRect(endPoint) }); } diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Events.cs b/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Events.cs index 82614619a95..d019e6df366 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Events.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Events.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using Microsoft.Toolkit.Uwp.Extensions; using Windows.Foundation; using Windows.System; using Windows.UI.Core; @@ -98,7 +99,7 @@ private void ImageCropperThumb_KeyDown(object sender, KeyRoutedEventArgs e) private void ImageCropperThumb_KeyUp(object sender, KeyRoutedEventArgs e) { - var selectedRect = new Rect(new Point(_startX, _startY), new Point(_endX, _endY)); + var selectedRect = new Point(_startX, _startY).ToRect(new Point(_endX, _endY)); var croppedRect = _inverseImageTransform.TransformBounds(selectedRect); if (croppedRect.Width > MinCropSize.Width && croppedRect.Height > MinCropSize.Height) { @@ -111,7 +112,7 @@ private void ImageCropperThumb_KeyUp(object sender, KeyRoutedEventArgs e) private void ImageCropperThumb_ManipulationCompleted(object sender, ManipulationCompletedRoutedEventArgs e) { - var selectedRect = new Rect(new Point(_startX, _startY), new Point(_endX, _endY)); + var selectedRect = new Point(_startX, _startY).ToRect(new Point(_endX, _endY)); var croppedRect = _inverseImageTransform.TransformBounds(selectedRect); if (croppedRect.Width > MinCropSize.Width && croppedRect.Height > MinCropSize.Height) { @@ -155,7 +156,7 @@ private void SourceImage_ManipulationDelta(object sender, ManipulationDeltaRoute offsetY = Math.Max(offsetY, _restrictedSelectRect.Y - _startY); } - var selectedRect = new Rect(new Point(_startX, _startY), new Point(_endX, _endY)); + var selectedRect = new Point(_startX, _startY).ToRect(new Point(_endX, _endY)); selectedRect.X += offsetX; selectedRect.Y += offsetY; var croppedRect = _inverseImageTransform.TransformBounds(selectedRect); diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Helpers.cs b/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Helpers.cs index bab3f27687a..0b722ea0b53 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Helpers.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Helpers.cs @@ -9,6 +9,7 @@ using Microsoft.Graphics.Canvas; using Microsoft.Graphics.Canvas.Effects; using Microsoft.Graphics.Canvas.Geometry; +using Microsoft.Toolkit.Uwp.Extensions; using Windows.Foundation; using Windows.Graphics.Imaging; using Windows.Storage.Streams; @@ -299,7 +300,7 @@ private static Rect GetSafeRect(Point startPoint, Point endPoint, Size minSize, break; } - return new Rect(startPoint, endPoint); + return startPoint.ToRect(endPoint); } /// diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Logic.cs b/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Logic.cs index 44c216e0e7f..18718fc8a6d 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Logic.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.Logic.cs @@ -4,6 +4,7 @@ using System; using System.Numerics; +using Microsoft.Toolkit.Uwp.Extensions; using Windows.Foundation; using Windows.UI.Xaml; using Windows.UI.Xaml.Hosting; @@ -111,7 +112,7 @@ private void UpdateCroppedRect(ThumbPosition position, Point diffPos) var startPoint = new Point(_startX, _startY); var endPoint = new Point(_endX, _endY); - var currentSelectedRect = new Rect(startPoint, endPoint); + var currentSelectedRect = startPoint.ToRect(endPoint); switch (position) { case ThumbPosition.Top: @@ -251,7 +252,7 @@ private void UpdateCroppedRect(ThumbPosition position, Point diffPos) var isEffectiveRegion = IsSafePoint(_restrictedSelectRect, startPoint) && IsSafePoint(_restrictedSelectRect, endPoint); - var selectedRect = new Rect(startPoint, endPoint); + var selectedRect = startPoint.ToRect(endPoint); if (!isEffectiveRegion) { if (!IsCornerThumb(position) && TryGetContainedRect(_restrictedSelectRect, ref selectedRect)) @@ -268,8 +269,7 @@ private void UpdateCroppedRect(ThumbPosition position, Point diffPos) selectedRect.Union(CanvasRect); if (selectedRect != CanvasRect) { - var croppedRect = _inverseImageTransform.TransformBounds( - new Rect(startPoint, endPoint)); + var croppedRect = _inverseImageTransform.TransformBounds(startPoint.ToRect(endPoint)); croppedRect.Intersect(_restrictedCropRect); _currentCroppedRect = croppedRect; var viewportRect = GetUniformRect(CanvasRect, selectedRect.Width / selectedRect.Height); @@ -460,7 +460,7 @@ private void UpdateMaskArea(bool animate = false) case CropShape.Rectangular: if (_innerGeometry is RectangleGeometry rectangleGeometry) { - var to = new Rect(new Point(_startX, _startY), new Point(_endX, _endY)); + var to = new Point(_startX, _startY).ToRect(new Point(_endX, _endY)); if (animate) { var storyboard = new Storyboard(); diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.cs b/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.cs index baa6c8657a4..48eecc3ca48 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/ImageCropper/ImageCropper.cs @@ -4,8 +4,8 @@ using System; using System.Threading.Tasks; +using Microsoft.Toolkit.Uwp.Extensions; using Windows.Foundation; -using Windows.Graphics.Imaging; using Windows.Storage; using Windows.Storage.Streams; using Windows.UI.Xaml; @@ -120,7 +120,7 @@ private Size MinSelectSize { get { - var realMinSelectSize = _imageTransform.TransformBounds(new Rect(default(Point), MinCropSize)); + var realMinSelectSize = _imageTransform.TransformBounds(MinCropSize.ToRect()); var minLength = Math.Min(realMinSelectSize.Width, realMinSelectSize.Height); if (minLength < MinSelectedLength) { diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/OrbitView/OrbitViewPanel.cs b/Microsoft.Toolkit.Uwp.UI.Controls/OrbitView/OrbitViewPanel.cs index ee6e75568ba..c39e2311073 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/OrbitView/OrbitViewPanel.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/OrbitView/OrbitViewPanel.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Microsoft.Toolkit.Uwp.Extensions; using Microsoft.Toolkit.Uwp.UI.Extensions; using Windows.Foundation; using Windows.UI.Xaml; @@ -131,7 +132,7 @@ protected override Size ArrangeOverride(Size finalSize) var y_normalized = (finalSize.Height / 2) - y - (element.DesiredSize.Height / 2); var point = new Point(x_normalized, y_normalized); - element.Arrange(new Rect(point, element.DesiredSize)); + element.Arrange(point.ToRect(element.DesiredSize)); var elementProperties = new OrbitViewElementProperties() { diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/RotatorTile/RotatorTile.cs b/Microsoft.Toolkit.Uwp.UI.Controls/RotatorTile/RotatorTile.cs index 2aab5261187..f89306e336a 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/RotatorTile/RotatorTile.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/RotatorTile/RotatorTile.cs @@ -5,8 +5,8 @@ using System; using System.Collections; using System.Collections.Specialized; +using Microsoft.Toolkit.Uwp.Extensions; using Microsoft.Toolkit.Uwp.Helpers; -using Windows.Foundation; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media; @@ -143,7 +143,7 @@ private void RotatorTile_SizeChanged(object sender, SizeChangedEventArgs e) } // Set clip to control - Clip = new RectangleGeometry() { Rect = new Rect(default(Point), e.NewSize) }; + Clip = new RectangleGeometry { Rect = e.NewSize.ToRect() }; } private void RotatorTile_Loaded(object sender, RoutedEventArgs e) diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/UniformGrid/UniformGrid.cs b/Microsoft.Toolkit.Uwp.UI.Controls/UniformGrid/UniformGrid.cs index 454177bd41e..2d19bc59bd0 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/UniformGrid/UniformGrid.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/UniformGrid/UniformGrid.cs @@ -152,7 +152,7 @@ protected override Size ArrangeOverride(Size finalSize) // Make sure all overflown elements have no size. foreach (var child in _overflow) { - child.Arrange(new Rect(0, 0, 0, 0)); + child.Arrange(default); } _overflow = new List(); // Reset for next time. diff --git a/Microsoft.Toolkit.Uwp/Extensions/PointExtensions.cs b/Microsoft.Toolkit.Uwp/Extensions/PointExtensions.cs new file mode 100644 index 00000000000..0da97e4c4ee --- /dev/null +++ b/Microsoft.Toolkit.Uwp/Extensions/PointExtensions.cs @@ -0,0 +1,58 @@ +// 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.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using Point = Windows.Foundation.Point; +using Rect = Windows.Foundation.Rect; +using Size = Windows.Foundation.Size; + +namespace Microsoft.Toolkit.Uwp.Extensions +{ + /// + /// Extensions for the type. + /// + public static class PointExtensions + { + /// + /// Creates a new of the specified size, starting at a given point. + /// + /// The input value to convert. + /// The width of the rectangle. + /// The height of the rectangle. + /// A value of the specified size, starting at the given point. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Rect ToRect(this Point point, double width, double height) + { + return new Rect(point.X, point.Y, width, height); + } + + /// + /// Creates a new ending at the specified point, starting at the given coordinates. + /// + /// The input value to convert. + /// The ending position for the rectangle. + /// A value between the two specified points. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Rect ToRect(this Point point, Point end) + { + return new Rect(point, end); + } + + /// + /// Creates a new of the specified size, starting at the given coordinates. + /// + /// The input value to convert. + /// The size of the rectangle to create. + /// A value of the specified size, starting at the given coordinates. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Rect ToRect(this Point point, Size size) + { + return new Rect(point, size); + } + } +} diff --git a/Microsoft.Toolkit.Uwp/Extensions/SizeExtensions.cs b/Microsoft.Toolkit.Uwp/Extensions/SizeExtensions.cs new file mode 100644 index 00000000000..b32ce516501 --- /dev/null +++ b/Microsoft.Toolkit.Uwp/Extensions/SizeExtensions.cs @@ -0,0 +1,57 @@ +// 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.Diagnostics.Contracts; +using System.Runtime.CompilerServices; +using Point = Windows.Foundation.Point; +using Rect = Windows.Foundation.Rect; +using Size = Windows.Foundation.Size; + +namespace Microsoft.Toolkit.Uwp.Extensions +{ + /// + /// Extensions for the type. + /// + public static class SizeExtensions + { + /// + /// Creates a new of the specified size, starting at the origin. + /// + /// The input value to convert. + /// A value of the specified size, starting at the origin. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Rect ToRect(this Size size) + { + return new Rect(0, 0, size.Width, size.Height); + } + + /// + /// Creates a new of the specified size, starting at the given coordinates. + /// + /// The input value to convert. + /// The horizontal offset. + /// The vertical offset. + /// A value of the specified size, starting at the given coordinates. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Rect ToRect(this Size size, double x, double y) + { + return new Rect(x, y, size.Width, size.Height); + } + + /// + /// Creates a new of the specified size, starting at the given position. + /// + /// The input value to convert. + /// The starting position to use. + /// A value of the specified size, starting at the given position. + [Pure] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Rect ToRect(this Size size, Point point) + { + return new Rect(point, size); + } + } +} diff --git a/UnitTests/UnitTests.UWP/Extensions/Test_PointExtensions.cs b/UnitTests/UnitTests.UWP/Extensions/Test_PointExtensions.cs new file mode 100644 index 00000000000..96a2f8133db --- /dev/null +++ b/UnitTests/UnitTests.UWP/Extensions/Test_PointExtensions.cs @@ -0,0 +1,65 @@ +// 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.Foundation; +using Microsoft.Toolkit.Uwp.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace UnitTests.Extensions +{ + [TestClass] + public class Test_PointExtensions + { + [TestCategory("PointExtensions")] + [TestMethod] + [DataRow(0d, 0d, 0, 0)] + [DataRow(0d, 0d, 22, 6.89d)] + [DataRow(3.14d, 6.55f, 3838d, 3.24724928d)] + [DataRow(double.MinValue, double.Epsilon, 22, 0.3248d)] + public static void Test_PointExtensions_ToRect_FromWidthHeight(double width, double height, int x, int y) + { + Point p = new Point(x, y); + Rect + a = p.ToRect(width, height), + b = new Rect(x, y, width, height); + + Assert.AreEqual(a, b); + } + + [TestCategory("SizeExtensions")] + [TestMethod] + [DataRow(0d, 0d, 0, 0)] + [DataRow(0d, 0d, 22, 6.89d)] + [DataRow(3.14d, 6.55f, 3838d, 3.24724928d)] + [DataRow(double.MinValue, double.Epsilon, 22, 0.3248d)] + public static void Test_PointExtensions_ToRect_FromPoint(double width, double height, int x, int y) + { + Point + p1 = new Point(x, y), + p2 = new Point(x + width, y + height); + Rect + a = p1.ToRect(p2), + b = new Rect(p1, p2); + + Assert.AreEqual(a, b); + } + + [TestCategory("SizeExtensions")] + [TestMethod] + [DataRow(0d, 0d, 0, 0)] + [DataRow(0d, 0d, 22, 6.89d)] + [DataRow(3.14d, 6.55f, 3838d, 3.24724928d)] + [DataRow(double.MinValue, double.Epsilon, 22, 0.3248d)] + public static void Test_PointExtensions_ToRect_FromSize(double width, double height, int x, int y) + { + Point p = new Point(x, y); + Size s = new Size(width, height); + Rect + a = p.ToRect(s), + b = new Rect(p, s); + + Assert.AreEqual(a, b); + } + } +} \ No newline at end of file diff --git a/UnitTests/UnitTests.UWP/Extensions/Test_SizeExtensions.cs b/UnitTests/UnitTests.UWP/Extensions/Test_SizeExtensions.cs new file mode 100644 index 00000000000..80193e2e29a --- /dev/null +++ b/UnitTests/UnitTests.UWP/Extensions/Test_SizeExtensions.cs @@ -0,0 +1,62 @@ +// 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.Foundation; +using Microsoft.Toolkit.Uwp.Extensions; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace UnitTests.Extensions +{ + [TestClass] + public class Test_SizeExtensions + { + [TestCategory("SizeExtensions")] + [TestMethod] + [DataRow(0d, 0d)] + [DataRow(3.14d, 6.55f)] + [DataRow(double.MinValue, double.Epsilon)] + public static void Test_SizeExtensions_ToRect_FromSize(double width, double height) + { + Size s = new Size(width, height); + Rect + a = s.ToRect(), + b = new Rect(0, 0, s.Width, s.Height); + + Assert.AreEqual(a, b); + } + + [TestCategory("SizeExtensions")] + [TestMethod] + [DataRow(0d, 0d, 0, 0)] + [DataRow(0d, 0d, 22, 6.89d)] + [DataRow(3.14d, 6.55f, 3838d, 3.24724928d)] + [DataRow(double.MinValue, double.Epsilon, 22, 0.3248d)] + public static void Test_SizeExtensions_ToRect_FromSizeAndPosition(double width, double height, int x, int y) + { + Size s = new Size(width, height); + Rect + a = s.ToRect(x, y), + b = new Rect(x, y, s.Width, s.Height); + + Assert.AreEqual(a, b); + } + + [TestCategory("SizeExtensions")] + [TestMethod] + [DataRow(0d, 0d, 0, 0)] + [DataRow(0d, 0d, 22, 6.89d)] + [DataRow(3.14d, 6.55f, 3838d, 3.24724928d)] + [DataRow(double.MinValue, double.Epsilon, 22, 0.3248d)] + public static void Test_SizeExtensions_ToRect_FromSizeAndPoint(double width, double height, int x, int y) + { + Point p = new Point(x, y); + Size s = new Size(width, height); + Rect + a = s.ToRect(p), + b = new Rect(p, s); + + Assert.AreEqual(a, b); + } + } +} \ No newline at end of file diff --git a/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj b/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj index 6ab314b8e48..24438302b11 100644 --- a/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj +++ b/UnitTests/UnitTests.UWP/UnitTests.UWP.csproj @@ -138,6 +138,8 @@ + +