TabControl
Organizes content into multiple tabs.Properties
- Items: Collection of TabItem elements
- SelectedIndex: Index of selected tab (int)
- SelectedItem: Currently selected TabItem
- SelectedContent: Content of selected tab
- TabStripPlacement: Position of tabs -
Top,Bottom,Left,Right - ContentTemplate: Template for tab content
Events
- SelectionChanged: Raised when selected tab changes
Example
- XAML
- C#
Styling Tabs
Menu
Provides a menu system for commands and options.Example
- XAML
- C#
Context Menu
TreeView
Displays hierarchical data in a tree structure.Properties
- Items: Root level items
- SelectedItem: Currently selected item
- AutoScrollToSelectedItem: Scroll to selected item (bool)
Events
- SelectionChanged: Raised when selection changes
Example
- XAML
- C#
ListBox
Displays a list of items.Properties
- Items: Collection of items
- SelectedItem: Selected item
- SelectedItems: Multiple selected items
- SelectionMode: Selection mode -
Single,Multiple,Toggle,AlwaysSelected - VirtualizationMode: Virtualization mode for performance
Example
Carousel
Displays items in a carousel that can be scrolled.Expander
A control with a header that can expand/collapse content.SplitView
Provides a container with two views: a collapsible pane and a content area.Best Practices
- Use TabControl for related content - Good for settings, wizards, or multiple views
- Keep menu hierarchies shallow - Avoid deeply nested menu items
- Use TreeView for hierarchical data - File systems, categories, organizational charts
- Implement lazy loading - Load tree/list items on demand for large datasets
- Use virtualization - Enable for lists with many items
- Provide keyboard navigation - Arrow keys, Tab, Enter for accessibility