Code Monkey home page Code Monkey logo

Comments (3)

lombo75 avatar lombo75 commented on May 24, 2024

Adding automationproperties fixes the menu button accessibility testing with narrator as it uses the built in providers for a button, I didn't think it was necessary to do a PR for three lines of code, maybe @JerryNixon you can add it in yourself on next merge.

<Button x:Name="HamburgerButton" Grid.Row="0"
Background="{x:Bind HamburgerBackground, FallbackValue=DarkRed, Mode=OneWay}"
Command="{x:Bind HamburgerCommand}"
Foreground="{x:Bind HamburgerForeground, FallbackValue=White, Mode=OneWay}"
RenderTransformOrigin="0.5,0.5"
Style="{StaticResource HamburgerButtonStyle}" 
AutomationProperties.AutomationId="HamburgerButton1"
AutomationProperties.Name="Menu"
AutomationProperties.HelpText="select to open a list of menu items">
<Button.RenderTransform>
<CompositeTransform />
</Button.RenderTransform>
<StackPanel Orientation="Horizontal">
<FontIcon FontSize="20" Glyph="&#xE700;" />
</StackPanel>
</Button>

the menu items are proving to be a challenge to get to work as the usercontrol is a custom control, it will require a custom automation peer be set in code for each control ie scrollview, toggle buttons from what I have learnt. I am trying to get it to work and will do a PR if I succeed.

Here are some links for anybody else that wants to have a crack at it

http://stackoverflow.com/questions/33964066/how-do-i-make-a-uwp-custom-i-e-templated-button-control-with-accessibility-su

https://msdn.microsoft.com/en-us/library/mt297667.aspx#determining_the_existing_state_of_ui_automation_support_for_your_custom_ui_class

https://msdn.microsoft.com/en-us/library/mt297665.aspx

https://msdn.microsoft.com/en-us/library/windows.ui.xaml.automation.peers.frameworkelementautomationpeer.createpeerforelement.aspx

https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k(Windows.UI.Xaml.Automation.Peers.ToggleButtonAutomationPeer);k(SolutionItemsProject);k(TargetFrameworkMoniker-.NETCore,Version%3Dv5.0);k(DevLang-csharp)&rd=true

from template10.

ArtjomP avatar ArtjomP commented on May 24, 2024

Hardcoding AutomationProperties for HamburgerButton in Template10 is not enough because it needs to be able to be changed in Resources by Uid to support localization

from template10.

JerryNixon avatar JerryNixon commented on May 24, 2024

No longer relevant

from template10.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.