|
| 1 | +--- |
| 2 | +title: Setting Semantic Properties for Navigation Buttons in Calendar |
| 3 | +description: Learn how to set SemanticProperties.Description for navigation buttons in the Calendar control in UI for .NET MAUI to meet accessibility requirements. |
| 4 | +type: how-to |
| 5 | +page_title: Adding Semantic Properties to Calendar Navigation Buttons for Accessibility |
| 6 | +meta_title: Adding Semantic Properties to Calendar Navigation Buttons for Accessibility in UI for .NET MAUI |
| 7 | +slug: set-semantic-properties-calendar-navigation-buttons |
| 8 | +tags: calendar, navigation-buttons, semanticproperties, accessibility, ui-for-dotnet-maui |
| 9 | +res_type: kb |
| 10 | +--- |
| 11 | + |
| 12 | +## Environment |
| 13 | + |
| 14 | +| Version | Product | Author | |
| 15 | +| --- | --- | --- | |
| 16 | +| 11.1.0 | Calendar for .NET MAUI | [Dobrinka Yordanova](https://www.telerik.com/blogs/author/dobrinka-yordanova) | |
| 17 | + |
| 18 | +## Description |
| 19 | + |
| 20 | +I need to set semantic properties, specifically the `SemanticProperties.Description`, for the navigation buttons in the [UI for .NET MAUI Calendar](https://www.telerik.com/maui-ui/documentation/controls/calendar/overview) control to meet accessibility standards. |
| 21 | + |
| 22 | +This knowledge base article also answers the following questions: |
| 23 | +- How do I add accessibility descriptions for calendar navigation buttons? |
| 24 | +- How can I set `SemanticProperties` for the Previous and Next navigation buttons in a calendar? |
| 25 | +- What is the method to define descriptions for navigation buttons in the .NET MAUI Calendar? |
| 26 | + |
| 27 | +## Solution |
| 28 | + |
| 29 | +To set the `SemanticProperties.Description` for the navigation buttons, use the `NavigateToPreviousViewButtonStyle` and `NavigateToNextViewButtonStyle` properties of the Calendar control. |
| 30 | + |
| 31 | +1. Define styles for the navigation buttons in XAML. |
| 32 | + |
| 33 | +```xml |
| 34 | +<Style TargetType="Button" x:Key="NavigateToPreviousViewButtonStyle"> |
| 35 | + <Setter Property="SemanticProperties.Description" Value="Navigate to previous view" /> |
| 36 | +</Style> |
| 37 | +<Style TargetType="Button" x:Key="NavigateToNextViewButtonStyle"> |
| 38 | + <Setter Property="SemanticProperties.Description" Value="Navigate to next view" /> |
| 39 | +</Style> |
| 40 | +``` |
| 41 | + |
| 42 | +2. Assign the styles to the Calendar control. |
| 43 | + |
| 44 | +```xml |
| 45 | +<telerik:RadCalendar x:Name="calendar" |
| 46 | + NavigateToPreviousViewButtonStyle="{StaticResource NavigateToPreviousViewButtonStyle}" |
| 47 | + NavigateToNextViewButtonStyle="{StaticResource NavigateToNextViewButtonStyle}" /> |
| 48 | +``` |
| 49 | + |
| 50 | +## See Also |
| 51 | + |
| 52 | +- [Styling the Header of the Calendar in UI for .NET MAUI](https://www.telerik.com/maui-ui/documentation/controls/calendar/styling/header-styling) |
| 53 | +- [UI for .NET MAUI Calendar Documentation](https://www.telerik.com/maui-ui/documentation/controls/calendar/overview) |
0 commit comments