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. (#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 authored and karkarl committed Jul 15, 2024
1 parent 80b03b0 commit eb8b48d
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 eb8b48d

Please sign in to comment.