Skip to content

Commit 162962a

Browse files
Merge branch 'master' into feature/array-extensions-deprecation
2 parents dadc6a7 + 9087194 commit 162962a

40 files changed

+1267
-104
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ assignees: ''
77

88
---
99

10-
<!--
11-
PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.
12-
ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
13-
-->
10+
<!-- 🚨 Please Do Not skip any instructions and information mentioned below as they are all required and essential to investigate the issue. Issues with missing information may be closed without investigation 🚨 -->
1411

1512
## Describe the bug
1613
A clear and concise description of what the bug is.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ assignees: ''
77

88
---
99

10+
<!-- 🚨 Please provide detailed information and Do Not skip any instructions as they are all required and essential to help us understand the feature 🚨 -->
11+
1012
## Describe the problem this feature would solve
1113
<!-- Please describe or link to any existing issues or discussions.
1214
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Hi!
1313
We try and keep our GitHub issue list for bugs and features.
1414
1515
Ideally, it'd be great to post your question on Stack Overflow using the 'windows-community-toolkit' tag here: https://stackoverflow.com/questions/tagged/windows-community-toolkit
16+
🚨 Please provide detailed information that includes examples, screenshots, and relevant issues if possible 🚨
1617
1718
If this is more about a scenario that you think is missing documentation, please file an issue instead at https://github.com/MicrosoftDocs/WindowsCommunityToolkitDocs/issues/new
1819

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- 🚨 Please Do Not skip any instructions and information mentioned below as they are all required and essential to evaluate and test the PR. By fulfilling all the required information you will be able to reduce the volume of questions and most likely help merge the PR faster 🚨 -->
2+
13
## Fixes #
24
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->
35

@@ -38,7 +40,7 @@ Please check if your PR fulfills the following requirements:
3840
- [ ] Contains **NO** breaking changes
3941

4042
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below.
41-
Please note that breaking changes are likely to be rejected. -->
43+
Please note that breaking changes are likely to be rejected within minor release cycles or held until major versions. -->
4244

4345

4446
## Other information

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,4 +227,8 @@ msbuild.binlog
227227
!/build/tools/packages.config
228228

229229
# Generated file from .ttinclude
230-
**/Generated/TypeInfo.g.cs
230+
**/Generated/TypeInfo.g.cs
231+
232+
# TAEF Log output
233+
WexLogFileOutput
234+
*.wtl

Microsoft.Toolkit.HighPerformance/Streams/MemoryStream.Validate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ namespace Microsoft.Toolkit.HighPerformance.Streams
1313
internal static partial class MemoryStream
1414
{
1515
/// <summary>
16-
/// Validates the <see cref="Stream.Position"/> argument.
16+
/// Validates the <see cref="Stream.Position"/> argument (it needs to be in the [0, length]) range.
1717
/// </summary>
1818
/// <param name="position">The new <see cref="Stream.Position"/> value being set.</param>
1919
/// <param name="length">The maximum length of the target <see cref="Stream"/>.</param>
2020
[MethodImpl(MethodImplOptions.AggressiveInlining)]
2121
public static void ValidatePosition(long position, int length)
2222
{
23-
if ((ulong)position >= (ulong)length)
23+
if ((ulong)position > (ulong)length)
2424
{
2525
ThrowArgumentOutOfRangeExceptionForPosition();
2626
}

Microsoft.Toolkit.Uwp.UI.Controls/ImageEx/ImageEx.xaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
<Setter Property="Template">
1010
<Setter.Value>
1111
<ControlTemplate TargetType="controls:ImageEx">
12-
<Grid Background="{TemplateBinding Background}" CornerRadius="{TemplateBinding CornerRadius}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
12+
<Grid Background="{TemplateBinding Background}"
13+
CornerRadius="{TemplateBinding CornerRadius}"
14+
BorderBrush="{TemplateBinding BorderBrush}"
15+
BorderThickness="{TemplateBinding BorderThickness}">
1316
<Image Name="PlaceholderImage"
1417
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
1518
VerticalAlignment="{TemplateBinding VerticalAlignment}"

Microsoft.Toolkit.Uwp.UI.Controls/ImageEx/ImageExBase.Members.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ public partial class ImageExBase
2020
/// </summary>
2121
public static readonly DependencyProperty StretchProperty = DependencyProperty.Register(nameof(Stretch), typeof(Stretch), typeof(ImageExBase), new PropertyMetadata(Stretch.Uniform));
2222

23-
/// <summary>
24-
/// Identifies the <see cref="CornerRadius"/> dependency property.
25-
/// </summary>
26-
public static new readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register(nameof(CornerRadius), typeof(CornerRadius), typeof(ImageExBase), new PropertyMetadata(new CornerRadius(0)));
27-
2823
/// <summary>
2924
/// Identifies the <see cref="DecodePixelHeight"/> dependency property.
3025
/// </summary>
@@ -81,16 +76,6 @@ public partial class ImageExBase
8176
/// </summary>
8277
public bool IsInitialized { get; private set; }
8378

84-
/// <summary>
85-
/// Gets or sets the CornerRadius for underlying image. <para/>
86-
/// Used to created rounded/circular images.
87-
/// </summary>
88-
public new CornerRadius CornerRadius
89-
{
90-
get { return (CornerRadius)GetValue(CornerRadiusProperty); }
91-
set { SetValue(CornerRadiusProperty, value); }
92-
}
93-
9479
/// <summary>
9580
/// Gets or sets DecodePixelHeight for underlying bitmap
9681
/// </summary>

UITests/UITests.App/App.xaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Application
2+
x:Class="UITests.App.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="using:UITests.App">
6+
7+
</Application>

UITests/UITests.App/App.xaml.cs

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
using Windows.ApplicationModel;
7+
using Windows.ApplicationModel.Activation;
8+
using Windows.UI.Xaml;
9+
using Windows.UI.Xaml.Controls;
10+
using Windows.UI.Xaml.Navigation;
11+
12+
namespace UITests.App
13+
{
14+
public sealed partial class App
15+
{
16+
public App()
17+
{
18+
this.InitializeComponent();
19+
this.Suspending += OnSuspending;
20+
}
21+
22+
/// <summary>
23+
/// Invoked when the application is launched normally by the end user. Other entry points
24+
/// will be used such as when the application is launched to open a specific file.
25+
/// </summary>
26+
/// <param name="e">Details about the launch request and process.</param>
27+
protected override void OnLaunched(LaunchActivatedEventArgs e)
28+
{
29+
Frame rootFrame = Window.Current.Content as Frame;
30+
31+
// Do not repeat app initialization when the Window already has content,
32+
// just ensure that the window is active
33+
if (rootFrame == null)
34+
{
35+
// Create a Frame to act as the navigation context and navigate to the first page
36+
rootFrame = new Frame();
37+
38+
rootFrame.NavigationFailed += OnNavigationFailed;
39+
40+
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
41+
{
42+
// TODO: Load state from previously suspended application
43+
}
44+
45+
// Place the frame in the current Window
46+
Window.Current.Content = rootFrame;
47+
}
48+
49+
if (e.PrelaunchActivated == false)
50+
{
51+
if (rootFrame.Content == null)
52+
{
53+
// When the navigation stack isn't restored navigate to the first page,
54+
// configuring the new page by passing required information as a navigation
55+
// parameter
56+
rootFrame.Navigate(typeof(MainPage), e.Arguments);
57+
}
58+
59+
// Ensure the current window is active
60+
Window.Current.Activate();
61+
}
62+
}
63+
64+
/// <summary>
65+
/// Invoked when Navigation to a certain page fails
66+
/// </summary>
67+
/// <param name="sender">The Frame which failed navigation</param>
68+
/// <param name="e">Details about the navigation failure</param>
69+
private void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
70+
{
71+
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
72+
}
73+
74+
/// <summary>
75+
/// Invoked when application execution is being suspended. Application state is saved
76+
/// without knowing whether the application will be terminated or resumed with the contents
77+
/// of memory still intact.
78+
/// </summary>
79+
/// <param name="sender">The source of the suspend request.</param>
80+
/// <param name="e">Details about the suspend request.</param>
81+
private void OnSuspending(object sender, SuspendingEventArgs e)
82+
{
83+
var deferral = e.SuspendingOperation.GetDeferral();
84+
85+
// TODO: Save application state and stop any background activity
86+
deferral.Complete();
87+
}
88+
}
89+
}

0 commit comments

Comments
 (0)