Skip to content

Commit 468caa9

Browse files
authored
Merge branch 'master' into fixYamlHeaderParser2
2 parents 65a720d + 8739735 commit 468caa9

File tree

12 files changed

+57
-68
lines changed

12 files changed

+57
-68
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ Windows 10 Build Number:
4242
- [ ] April 2018 Update (17134)
4343
- [ ] October 2018 Update (17763)
4444
- [ ] May 2019 Update (18362)
45+
- [ ] May 2020 Update (19041)
4546
- [ ] Insider Build (build number: )
4647
4748
App min and target version:
4849
- [ ] Fall Creators Update (16299)
4950
- [ ] April 2018 Update (17134)
5051
- [ ] October 2018 Update (17763)
5152
- [ ] May 2019 Update (18362)
53+
- [ ] May 2020 Update (19041)
5254
- [ ] Insider Build (xxxxx)
5355
5456
Device form factor:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
## Fixes #<!-- Link to relevant issue (for ex: #1234) which will automatically close the issue once the PR is merged. -->
1+
## Fixes #
2+
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->
23

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

Microsoft.Toolkit.Services/Microsoft.Toolkit.Services.csproj

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
<DefineConstants Condition="'$(DisableImplicitFrameworkDefines)' != 'true'">$(DefineConstants);WINRT</DefineConstants>
2020
</PropertyGroup>
2121

22+
<PropertyGroup Condition="'$(TargetFramework)' == 'net462'">
23+
<UseWpf>true</UseWpf>
24+
<EnableDefaultPageItems>false</EnableDefaultPageItems>
25+
</PropertyGroup>
26+
2227
<ItemGroup>
2328
<ProjectReference Include="..\Microsoft.Toolkit.Parsers\Microsoft.Toolkit.Parsers.csproj" />
2429
<ProjectReference Include="..\Microsoft.Toolkit\Microsoft.Toolkit.csproj" />
@@ -40,28 +45,9 @@
4045
</ItemGroup>
4146

4247
<ItemGroup Condition="'$(TargetFramework)'=='net462'">
43-
<Reference Include="System.Data" />
44-
<Reference Include="System.ComponentModel" />
45-
<Reference Include="System.Drawing" />
46-
<Reference Include="System.Windows" />
47-
<Reference Include="System.Windows.Forms" />
4848
<Reference Include="System.Web" />
49-
<Reference Include="System.Xaml">
50-
<RequiredTargetFramework>4.0</RequiredTargetFramework>
51-
</Reference>
52-
<Reference Include="WindowsBase" />
53-
<Reference Include="PresentationCore" />
54-
<Reference Include="PresentationFramework" />
5549
<PackageReference Include="Microsoft.Toolkit.Wpf.UI.Controls.WebView" Version="[5.0.0-preview.gb86cb1c4cb,)" />
5650
<PackageReference Include="Microsoft.Toolkit.Forms.UI.Controls.WebView" Version="[5.0.0-preview.gb86cb1c4cb,)" />
57-
<Page Update="PlatformSpecific\NetFramework\PopupWPF.xaml">
58-
<Generator>MSBuild:Compile</Generator>
59-
<SubType>Designer</SubType>
60-
</Page>
61-
<Compile Update="PlatformSpecific\NetFramework\PopupWPF.xaml.cs">
62-
<DependentUpon>PlatformSpecific\NetFramework\PopupWPF.xaml</DependentUpon>
63-
<SubType>Code</SubType>
64-
</Compile>
6551
</ItemGroup>
6652

6753
<ItemGroup Condition="!('$(TargetFramework)'=='uap10.0.16299')">

Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard1.4;uap10.0;native;net461;netcoreapp3.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard1.4;uap10.0;native;net461;netcoreapp3.1</TargetFrameworks>
55
<DefineConstants>$(DefineConstants);NETFX_CORE</DefineConstants>
66
<Title>Windows Community Toolkit Notifications</Title>
77
<Description>

Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification/InAppNotification.Events.cs

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
using Microsoft.Toolkit.Uwp.Extensions;
76
using Windows.UI.Xaml;
8-
using Windows.UI.Xaml.Automation;
97
using Windows.UI.Xaml.Automation.Peers;
108

119
namespace Microsoft.Toolkit.Uwp.UI.Controls
@@ -35,19 +33,6 @@ public partial class InAppNotification
3533
/// </summary>
3634
public event InAppNotificationClosedEventHandler Closed;
3735

38-
private static void AutomateTextNotification(AutomationPeer peer, string message)
39-
{
40-
if (peer != null)
41-
{
42-
peer.SetFocus();
43-
peer.RaiseNotificationEvent(
44-
AutomationNotificationKind.Other,
45-
AutomationNotificationProcessing.ImportantMostRecent,
46-
StringExtensions.GetLocalized("WindowsCommunityToolkit_InAppNotification_Events_NewNotificationMessage", "/Microsoft.Toolkit.Uwp.UI.Controls/Resources") + message,
47-
Guid.NewGuid().ToString());
48-
}
49-
}
50-
5136
private void DismissButton_Click(object sender, RoutedEventArgs e)
5237
{
5338
Dismiss(InAppNotificationDismissKind.User);
@@ -74,21 +59,23 @@ private void OnCurrentStateChanged(object sender, VisualStateChangedEventArgs e)
7459
private void OnNotificationVisible()
7560
{
7661
Opened?.Invoke(this, EventArgs.Empty);
77-
SetValue(AutomationProperties.NameProperty, StringExtensions.GetLocalized("WindowsCommunityToolkit_InAppNotification_NameProperty", "/Microsoft.Toolkit.Uwp.UI.Controls/Resources"));
78-
if (ContentTemplateRoot != null)
79-
{
80-
var peer = FrameworkElementAutomationPeer.CreatePeerForElement(ContentTemplateRoot);
81-
if (Content?.GetType() == typeof(string))
82-
{
83-
AutomateTextNotification(peer, Content.ToString());
84-
}
85-
}
8662
}
8763

8864
private void OnNotificationCollapsed()
8965
{
9066
Closed?.Invoke(this, new InAppNotificationClosedEventArgs(_lastDismissKind));
9167
Visibility = Visibility.Collapsed;
9268
}
69+
70+
private void RaiseAutomationNotification()
71+
{
72+
if (!AutomationPeer.ListenerExists(AutomationEvents.LiveRegionChanged))
73+
{
74+
return;
75+
}
76+
77+
var peer = FrameworkElementAutomationPeer.CreatePeerForElement(this);
78+
peer.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged);
79+
}
9380
}
9481
}

Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification/InAppNotification.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
using System;
66
using System.Collections.Generic;
77
using System.Linq;
8+
using Microsoft.Toolkit.Uwp.Extensions;
9+
using Microsoft.Toolkit.Uwp.UI.Extensions;
810
using Windows.UI.Xaml;
11+
using Windows.UI.Xaml.Automation;
912
using Windows.UI.Xaml.Controls;
1013

1114
namespace Microsoft.Toolkit.Uwp.UI.Controls
@@ -59,6 +62,7 @@ protected override void OnApplyTemplate()
5962
{
6063
_dismissButton.Visibility = ShowDismissButton ? Visibility.Visible : Visibility.Collapsed;
6164
_dismissButton.Click += DismissButton_Click;
65+
AutomationProperties.SetName(_dismissButton, StringExtensions.GetLocalized("WindowsCommunityToolkit_InAppNotification_DismissButton_AutomationName", "Microsoft.Toolkit.Uwp.UI.Controls/Resources"));
6266
}
6367

6468
if (_visualStateGroup != null)
@@ -72,6 +76,8 @@ protected override void OnApplyTemplate()
7276
UpdateContent(firstNotification);
7377
VisualStateManager.GoToState(this, StateContentVisible, true);
7478
}
79+
80+
AutomationProperties.SetLabeledBy(this, VisualTree.FindDescendant<ContentPresenter>(this));
7581
}
7682

7783
/// <summary>
@@ -240,6 +246,8 @@ private void UpdateContent(NotificationOptions notificationOptions)
240246
_contentProvider.Content = content;
241247
break;
242248
}
249+
250+
RaiseAutomationNotification();
243251
}
244252

245253
/// <summary>
@@ -276,11 +284,11 @@ private void Show(NotificationOptions notificationOptions)
276284

277285
if (shouldDisplayImmediately)
278286
{
279-
UpdateContent(notificationOptions);
280-
281287
Visibility = Visibility.Visible;
282288
VisualStateManager.GoToState(this, StateContentVisible, true);
283289

290+
UpdateContent(notificationOptions);
291+
284292
if (notificationOptions.Duration > 0)
285293
{
286294
_dismissTimer.Interval = TimeSpan.FromMilliseconds(notificationOptions.Duration);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
<Setter Property="AnimationDuration" Value="0:0:0.100" />
2929
<Setter Property="VerticalOffset" Value="100" />
3030
<Setter Property="HorizontalOffset" Value="0" />
31+
<Setter Property="AutomationProperties.LandmarkType" Value="Custom" />
32+
<!-- The setter value is localized using x:Uid but we still need to set it explicitly to avoid a compiler warning -->
33+
<Setter x:Uid="WindowsCommunityToolkit_InAppNotification_LandmarkProperty" Property="AutomationProperties.LocalizedLandmarkType" Value="Notification" />
34+
<Setter Property="AutomationProperties.LiveSetting" Value="Assertive" />
3135
<Setter Property="Template" Value="{StaticResource MSEdgeNotificationTemplate}" />
3236
</Style>
3337

Microsoft.Toolkit.Uwp.UI.Controls/InAppNotification/Styles/MSEdgeNotificationStyle.xaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,18 @@
3131
</ResourceDictionary>
3232
</ResourceDictionary.ThemeDictionaries>
3333

34+
<x:Double x:Key="SystemControlMSEdgeNotificationDismissButtonSize">40</x:Double>
35+
<Thickness x:Key="SystemControlMSEdgeNotificationDismissButtonMargin">24,0,0,0</Thickness>
36+
<x:Double x:Key="SystemControlMSEdgeNotificationDismissButtonTranslate">18</x:Double>
37+
<VerticalAlignment x:Key="SystemControlMSEdgeNotificationDismissButtonVerticalAlignment">Center</VerticalAlignment>
38+
<Thickness x:Key="SystemControlMSEdgeNotificationButtonBorderThickness">2</Thickness>
39+
3440
<Style x:Key="DismissTextBlockButtonStyle"
3541
TargetType="ButtonBase">
3642
<Setter Property="Background" Value="{ThemeResource HyperlinkButtonBackground}" />
3743
<Setter Property="Foreground" Value="{ThemeResource ApplicationForegroundThemeBrush}" />
38-
<Setter Property="Width" Value="40" />
39-
<Setter Property="Height" Value="40" />
44+
<Setter Property="Width" Value="{StaticResource SystemControlMSEdgeNotificationDismissButtonSize}" />
45+
<Setter Property="Height" Value="{StaticResource SystemControlMSEdgeNotificationDismissButtonSize}" />
4046
<Setter Property="UseSystemFocusVisuals" Value="True" />
4147
<Setter Property="HighContrastAdjustment" Value="None" />
4248
<Setter Property="Template">
@@ -46,9 +52,10 @@
4652
Margin="{TemplateBinding Padding}"
4753
Background="{TemplateBinding Background}">
4854
<Border x:Name="TextBorder"
49-
BorderBrush="{ThemeResource SystemControlMSEdgeNotificationButtonBorderBrush}"
50-
BorderThickness="2">
55+
BorderThickness="{StaticResource SystemControlMSEdgeNotificationButtonBorderThickness}"
56+
BorderBrush="{ThemeResource SystemControlMSEdgeNotificationButtonBorderBrush}">
5157
<ContentPresenter x:Name="Text"
58+
AutomationProperties.AccessibilityView="Raw"
5259
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
5360
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
5461
Content="{TemplateBinding Content}" />
@@ -143,11 +150,12 @@
143150

144151
<Button x:Name="PART_DismissButton"
145152
Grid.Column="1"
146-
Margin="24,0,0,0"
153+
Margin="{StaticResource SystemControlMSEdgeNotificationDismissButtonMargin}"
147154
AutomationProperties.Name="Dismiss"
148155
Content="&#xE894;"
149156
FontFamily="Segoe MDL2 Assets"
150157
FontSize="16"
158+
VerticalAlignment="{StaticResource SystemControlMSEdgeNotificationDismissButtonVerticalAlignment}"
151159
Style="{StaticResource DismissTextBlockButtonStyle}">
152160
<Button.RenderTransform>
153161
<TranslateTransform x:Name="DismissButtonTransform" X="18" />

Microsoft.Toolkit.Uwp.UI.Controls/Strings/en-US/Resources.resw

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@
205205
<value>GridSplitter</value>
206206
<comment>Narrator Resource for GridSplitter control</comment>
207207
</data>
208-
<data name="WindowsCommunityToolkit_InAppNotification_Events_NewNotificationMessage" xml:space="preserve">
209-
<value>New notification</value>
210-
<comment>Narrator resource for a new notification using the InAppNotification</comment>
208+
<data name="WindowsCommunityToolkit_InAppNotification_DismissButton_AutomationName" xml:space="preserve">
209+
<value>Dismiss</value>
210+
<comment>The automation name for the dismiss button of the InAppNotification control.</comment>
211211
</data>
212-
<data name="WindowsCommunityToolkit_InAppNotification_NameProperty" xml:space="preserve">
212+
<data name="WindowsCommunityToolkit_InAppNotification_LandmarkProperty.Value" xml:space="preserve">
213213
<value>Notification</value>
214-
<comment>Name property for InAppNotification</comment>
214+
<comment>The landmark name for the InAppNotification control. It is said by the narrator when using landmark navigation.</comment>
215215
</data>
216216
<data name="WindowsCommunityToolkit_TabView_CloseButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
217217
<value>Close tab</value>

UnitTests/UnitTests.UWP/Helpers/Test_StorageFileHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace UnitTests.Helpers
1515
public class Test_StorageFileHelper
1616
{
1717
private const string Sampletext = "Lorem ipsum dolor sit amet";
18-
private const string Filename = "filename.txt";
18+
private const string Filename = "Test_StorageFileHelper_file.txt";
1919
private const string PackagedFilePath = @"Assets\Samples\lorem.txt";
2020

2121
[TestCategory("Helpers")]

0 commit comments

Comments
 (0)