Skip to content

Commit ebb294d

Browse files
committed
Merge branch 'jamesmcroft/tokenizingtextbox-automationpeer' of https://github.com/windows-toolkit/WindowsCommunityToolkit into jamesmcroft/tokenizingtextbox-automationpeer
2 parents 299dc32 + d54299e commit ebb294d

File tree

41 files changed

+943
-130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+943
-130
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ IF NOT CERTAIN ABOUT THE FEATURE AND REQUIRE MORE CLARITY THEN PLEASE POST ON "I
1515
<!-- Please describe or link to any existing issues or discussions.
1616
A clear and concise description of what the problem is, starting with the user story.
1717
Provide examples of the restrictions in the current environment that hinders the work your users or you want to perform. What are the ways this new feature will help transform and deliver those results?
18-
For example, I am currently using the InfiniteCanvas control which lacks the ribbon control feature. I am looking to improve user experience therefore i would like to use that in my project to provide ease of accessibility and a user-friendly interface. This new feature will provide quick access to the toolbar, enhance space utilization, etc [...] -->
18+
For example, I am currently using the InfiniteCanvas control which lacks the TabbedCommandBar control feature. I am looking to improve user experience therefore i would like to use that in my project to provide ease of accessibility and a user-friendly interface. This new feature will provide quick access to the toolbar, enhance space utilization, etc [...] -->
1919

2020

2121
## Describe the solution

Microsoft.Toolkit.Diagnostics/Microsoft.Toolkit.Diagnostics.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- Guard: Helper methods to verify conditions when running code.
1212
- ThrowHelper: Helper methods to efficiently throw exceptions.
1313
</Description>
14-
<PackageTags>UWP Toolkit Windows IncrementalLoadingCollection String Array extensions helpers</PackageTags>
14+
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Incremental;Loading;Collection;IncrementalLoadingCollection;String;Array;extensions;helpers</PackageTags>
1515
</PropertyGroup>
1616
<Choose>
1717
<When Condition=" '$(TargetFramework)' == 'netstandard1.4' ">

Microsoft.Toolkit.HighPerformance/Microsoft.Toolkit.HighPerformance.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
- Ref&lt;T&gt;: a stack-only struct that can store a reference to a value of a specified type.
2323
- NullableRef&lt;T&gt;: a stack-only struct similar to Ref&lt;T&gt;, which also supports nullable references.
2424
</Description>
25-
<PackageTags>UWP Toolkit Windows core standard unsafe span memory string array stream buffer extensions helpers parallel performance</PackageTags>
25+
<PackageTags>Windows;Community;Toolkit;WCT;UWP;core;standard;unsafe;span;memory;string;array;stream;buffer;extensions;helpers;parallel;performance</PackageTags>
2626
</PropertyGroup>
2727
<Choose>
2828
<When Condition=" '$(TargetFramework)' == 'netstandard1.4' ">

Microsoft.Toolkit.Mvvm/Microsoft.Toolkit.Mvvm.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- StrongReferenceMessenger: a high-performance messaging system that trades weak references for speed.
1818
- Ioc: a helper class to configure dependency injection service containers.
1919
</Description>
20-
<PackageTags>UWP Toolkit Windows MVVM MVVMToolkit observable Ioc dependency injection services extensions helpers</PackageTags>
20+
<PackageTags>Windows;Community;Toolkit;WCT;UWP;WinUI;WPF;Xamarin;Forms;Uno;Platform;MVVM;Toolkit;MVVMToolkit;INotifyPropertyChanged;observable;Ioc;dependency injection;services;extensions;helpers</PackageTags>
2121
</PropertyGroup>
2222

2323
<!-- .NET Standard 2.0 doesn't have the Span<T> and IAsyncEnumerable<T> types -->

Microsoft.Toolkit.Uwp.Connectivity/Microsoft.Toolkit.Uwp.Connectivity.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
55
<Title>Windows Community Toolkit Devices</Title>
66
<Description>This library enables easier consumption of connectivity Devices/Peripherals and handle its connection to Windows devices. It contains BluetoothLE and Network connectivity helpers.</Description>
7-
<PackageTags>UWP Toolkit Windows Devices Bluetooth BluetoothLE BLE Networking</PackageTags>
7+
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Devices;Bluetooth;LE;BluetoothLE;BLE;Networking</PackageTags>
88
</PropertyGroup>
99

1010
<ItemGroup>

Microsoft.Toolkit.Uwp.DeveloperTools/FocusTracker/FocusTracker.cs

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ public partial class FocusTracker : Control
3434

3535
private static void OnIsActiveChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
3636
{
37-
var focusTracker = d as FocusTracker;
38-
39-
if (e.NewValue != null && (bool)e.NewValue)
37+
if (d is FocusTracker focusTracker)
4038
{
41-
focusTracker?.Start();
42-
}
43-
else
44-
{
45-
focusTracker?.Stop();
39+
if (e.NewValue != null && (bool)e.NewValue)
40+
{
41+
focusTracker.Start();
42+
}
43+
else
44+
{
45+
focusTracker.Stop();
46+
}
4647
}
4748
}
4849

49-
private DispatcherQueueTimer updateTimer;
5050
private TextBlock controlName;
5151
private TextBlock controlType;
5252
private TextBlock controlAutomationName;
@@ -69,32 +69,42 @@ public FocusTracker()
6969
DefaultStyleKey = typeof(FocusTracker);
7070
}
7171

72+
/// <summary>
73+
/// Update the visual state of the control when its template is changed.
74+
/// </summary>
75+
protected override void OnApplyTemplate()
76+
{
77+
controlName = GetTemplateChild("ControlName") as TextBlock;
78+
controlType = GetTemplateChild("ControlType") as TextBlock;
79+
controlAutomationName = GetTemplateChild("ControlAutomationName") as TextBlock;
80+
controlFirstParentWithName = GetTemplateChild("ControlFirstParentWithName") as TextBlock;
81+
}
82+
7283
private void Start()
7384
{
74-
if (updateTimer == null)
85+
// Get currently focused control once when we start
86+
if (Windows.Foundation.Metadata.ApiInformation.IsPropertyPresent("Windows.UI.Xaml.UIElement", "XamlRoot") && XamlRoot != null)
7587
{
76-
updateTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();
77-
updateTimer.Tick += UpdateTimer_Tick;
88+
FocusOnControl(FocusManager.GetFocusedElement(XamlRoot) as FrameworkElement);
89+
}
90+
else
91+
{
92+
FocusOnControl(FocusManager.GetFocusedElement() as FrameworkElement);
7893
}
7994

80-
updateTimer.Start();
95+
// Then use FocusManager event from 1809 to listen to updates
96+
FocusManager.GotFocus += FocusManager_GotFocus;
8197
}
8298

8399
private void Stop()
84100
{
85-
updateTimer?.Stop();
101+
FocusManager.GotFocus -= FocusManager_GotFocus;
86102
ClearContent();
87103
}
88104

89-
/// <summary>
90-
/// Update the visual state of the control when its template is changed.
91-
/// </summary>
92-
protected override void OnApplyTemplate()
105+
private void FocusManager_GotFocus(object sender, FocusManagerGotFocusEventArgs e)
93106
{
94-
controlName = GetTemplateChild("ControlName") as TextBlock;
95-
controlType = GetTemplateChild("ControlType") as TextBlock;
96-
controlAutomationName = GetTemplateChild("ControlAutomationName") as TextBlock;
97-
controlFirstParentWithName = GetTemplateChild("ControlFirstParentWithName") as TextBlock;
107+
FocusOnControl(e.NewFocusedElement as FrameworkElement);
98108
}
99109

100110
private void ClearContent()
@@ -105,19 +115,8 @@ private void ClearContent()
105115
controlFirstParentWithName.Text = string.Empty;
106116
}
107117

108-
private void UpdateTimer_Tick(object sender, object e)
118+
private void FocusOnControl(FrameworkElement focusedControl)
109119
{
110-
FrameworkElement focusedControl;
111-
112-
if (Windows.Foundation.Metadata.ApiInformation.IsPropertyPresent("Windows.UI.Xaml.UIElement", "XamlRoot") && XamlRoot != null)
113-
{
114-
focusedControl = FocusManager.GetFocusedElement(XamlRoot) as FrameworkElement;
115-
}
116-
else
117-
{
118-
focusedControl = FocusManager.GetFocusedElement() as FrameworkElement;
119-
}
120-
121120
if (focusedControl == null)
122121
{
123122
ClearContent();

Microsoft.Toolkit.Uwp.DeveloperTools/Microsoft.Toolkit.Uwp.DeveloperTools.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
-FocusTrackerControl : The FocusTracker Control is a feature that can be used to display information about the current focused XAML element.
1010
-Themes : Provides the source path of the resource dictionaries for the FocusTracker.
1111
</Description>
12-
<PackageTags>UWP Toolkit Windows Controls XAML Developer Tools Accessibility AlignmentGrid</PackageTags>
12+
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Controls;XAML;Developer;Tools;Accessibility;Alignment;Grid;AlignmentGrid</PackageTags>
1313
<!-- ARM64 builds for managed apps use .NET Native. We can't use the Reflection Provider for that. -->
1414
<EnableTypeInfoReflection Condition="'$(Configuration)' == 'Debug'">false</EnableTypeInfoReflection>
1515
</PropertyGroup>

Microsoft.Toolkit.Uwp.Input.GazeInteraction/Microsoft.Toolkit.Uwp.Input.GazeInteraction.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>uap10.0.17134</TargetFramework>
55
<Title>Windows Community Toolkit Eye Gaze Library</Title>
66
<Description>A library to integrate gaze interactions using eye trackers into UWP applications</Description>
7-
<PackageTags>UWP Toolkit Windows Eye Gaze EyeTracker</PackageTags>
7+
<PackageTags>Windows;Community;Toolkit;WCT;UWP;Gaze;Eye;Tracker;EyeTracker</PackageTags>
88
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
99
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
1010
</PropertyGroup>

Microsoft.Toolkit.Uwp.Notifications/Toasts/Compat/Desktop/Win32AppInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private static string HashAppId(string appId)
126126
private static string GetDisplayNameFromCurrentProcess(Process process)
127127
{
128128
// If AssemblyTitle is set, use that
129-
var assemblyTitleAttr = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyTitleAttribute>();
129+
var assemblyTitleAttr = Assembly.GetEntryAssembly()?.GetCustomAttribute<AssemblyTitleAttribute>();
130130
if (assemblyTitleAttr != null)
131131
{
132132
return assemblyTitleAttr.Title;

Microsoft.Toolkit.Uwp.Notifications/Toasts/Compat/ToastNotifierCompat.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ private void PreprocessToast(ToastNotification notification)
143143
// For apps that don't have identity...
144144
if (!DesktopBridgeHelpers.HasIdentity())
145145
{
146-
// If tag is specified
147-
if (!string.IsNullOrEmpty(notification.Tag))
146+
// If tag is specified and group isn't specified
147+
if (!string.IsNullOrEmpty(notification.Tag) && string.IsNullOrEmpty(notification.Group))
148148
{
149-
// If group isn't specified, we have to add a group since otherwise can't remove without a group
149+
// We have to add a group since otherwise can't remove without a group
150150
notification.Group = ToastNotificationManagerCompat.DEFAULT_GROUP;
151151
}
152152
}
@@ -157,10 +157,10 @@ private void PreprocessScheduledToast(ScheduledToastNotification notification)
157157
// For apps that don't have identity...
158158
if (!DesktopBridgeHelpers.HasIdentity())
159159
{
160-
// If tag is specified
161-
if (!string.IsNullOrEmpty(notification.Tag))
160+
// If tag is specified and group isn't specified
161+
if (!string.IsNullOrEmpty(notification.Tag) && string.IsNullOrEmpty(notification.Group))
162162
{
163-
// If group isn't specified, we have to add a group since otherwise can't remove without a group
163+
// We have to add a group since otherwise can't remove without a group
164164
notification.Group = ToastNotificationManagerCompat.DEFAULT_GROUP;
165165
}
166166
}

0 commit comments

Comments
 (0)