Skip to content

Commit

Permalink
Add ToString method to view model in StandardUICommand sample so acce…
Browse files Browse the repository at this point in the history
…ssibility name does not default to data type name. (microsoft#1382)

Without a ToString, accessibility tools end up using the TypeName. 


![image](https://github.com/microsoft/WinUI-Gallery/assets/28935693/6604dc35-626d-484d-b300-4c366acdb6fd)

After fix:

![image](https://github.com/microsoft/WinUI-Gallery/assets/28935693/d809ffdd-7532-4177-a5a5-06a81fa21ac5)
  • Loading branch information
ranjeshj committed Oct 16, 2023
1 parent b1572ee commit afd79ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions WinUIGallery/ControlPages/StandardUICommandPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ public class ListItemData
{
public string Text { get; set; }
public ICommand Command { get; set; }

public override string ToString()
{
return Text;
}
}

public sealed partial class StandardUICommandPage : Page
Expand Down

0 comments on commit afd79ce

Please sign in to comment.