WinUI XAML Controls Reference
WinUI provides a comprehensive set of XAML controls that form the building blocks of modern Windows applications. These controls are designed to be flexible, accessible, and visually consistent with the Windows Fluent Design System.
Common Controls
Explore the essential controls for building user interfaces:
Button
A clickable button that performs an action when tapped or clicked. Supports various styles and content.
Example Usage:
<Button Content="Click Me" Click="Button_Click" />
TextBlock
Displays read-only text. Supports rich text formatting, inline images, and complex layouts.
Example Usage:
<TextBlock Text="Hello, WinUI!" FontSize="24" FontWeight="SemiBold" />
TextBox
Allows users to enter and edit text. Supports multi-line input, password masking, and validation.
Example Usage:
<TextBox PlaceholderText="Enter your name" />
Image
Displays image files. Supports various source types and resizing modes.
Example Usage:
<Image Source="ms-appx:///Assets/Logo.png" />
CheckBox / RadioButton
Provides options for users to select or deselect items. RadioButtons are used for exclusive selection within a group.
Example Usage:
<StackPanel Orientation="Horizontal"> <CheckBox Content="Option 1" /> <RadioButton Content="Choice A" GroupName="Choices" /> <RadioButton Content="Choice B" GroupName="Choices" /> </StackPanel>
Slider
Allows users to select a value from a continuous range.
Example Usage:
<Slider Minimum="0" Maximum="100" />
Layout Controls
Arrange your UI elements effectively with these layout containers:
Items View Controls
Display collections of data efficiently:
Navigation Controls
Enable navigation within your application:
Content Controls
Display and manage content:
For detailed API reference and advanced usage, please refer to the specific control documentation linked above.