Bug report (I searched for similar issues and did not find one)
Unless I restyle (provide data template for each notification) InAppNotification text is not a tab stop. Hence, it is not accessible to blind users.
InAppNotification control cannot be used as Narrator live region via AutomationProperties.LiveSetting without restyling and searching for child. Here's the workaround I am using at the moment:
this.errorNotification.Show(template as DataTemplate);
notificationTextBlock = Utils.FindVisualChild<TextBlock>(this.errorNotification, typeof(TextBlock), "BlockName");
if (notificationTextBlock != null)
{
Utils.RaiseLiveRegionChanged(notificationTextBlock);
}
Additional problem is that if I style the control like below, I found no way to programmatically set text for the text block, only via resource. But setting it via resource doesn't allow dynamic content:
<DataTemplate x:Key="NotifyCommonErrorTemplate">
<UserControl>
<ScrollViewer IsTabStop="True">
<TextBlock x:Name="NotifyCommonErrorTextBlock"
x:Uid="NotifyCommonErrorTextBlock"
TextWrapping="Wrap"
VerticalAlignment="Center"
AutomationProperties.LiveSetting="Assertive" />
</ScrollViewer>
</UserControl>
</DataTemplate>
InAppNotification should allow:
Nuget Package(s):
6.1.24
Package Version(s):
Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [x ] April 2018 Update (17134)
- [ ] Insider Build (build number: )
App min and target version:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ x] April 2018 Update (17134)
- [ ] Insider Build (xxxxx)
Device form factor:
- [ x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT
Visual Studio
- [ x] 2017 (version: 15.7.2)
- [ ] 2017 Preview (version: )
All great feedback that we need to address. ping @Odonno
Here's workaround I had to do to make non-styled default InAppNotification usable as live region:
this.errorNotification.Show(string.Format(resourceLoader.GetString("Error/Unhandled/Content"), errorCode));
//
// Workaround for issue where InAppNotification does not allow live region unless restyled. Then, restyled doesn't
// allow setting dynamic string.
//
var textBlock = Utils.FindVisualChildNamedOrFirst<TextBlock>(this.errorNotification, typeof(TextBlock), "" /*first text block*/);
if (textBlock != null)
{
textBlock.SetValue(AutomationProperties.LiveSettingProperty, AutomationLiveSetting.Assertive);
Utils.RaiseLiveRegionChanged(textBlock);
}
I couldn't style one of the notifications, because it takes dynamic content. Note, this one is not a tab stop and there's nothing I can do to make it accessible, short of programmatically creating ScrollViewer and re-parenting the TextBlock.
[ing @Odonno
Sorry, I will try to take a look but I already have some work before this task. @vleonavmsft Feel free to start a PR if you like.
This issue seems inactive. Do you need help to complete this issue?
@vleonavmsft Did you try read the text pressing Caps Lock + arrow key with the Narrator enabled?
This issue seems inactive. Do you need help to complete this issue?
Was someone able to reproduce the issue, or issued a fix? I was able to work it around locally, but is this the desired way of raising LiveRegion notification for this control? If it is, go ahead and close the issue.
@vleonavmsft I believe this is closed now with PR #2781. Let us know if you try out the latest master and find any other concerns.
Most helpful comment
All great feedback that we need to address. ping @Odonno