/syncfusion-winui:syncfusion-winui-segmented-controlfrom Syncfusion WinUI Controls
Guide for implementing the Syncfusion WinUI Segmented Control for creating mutually exclusive option selectors. Use this skill when implementing segmented controls, segment pickers, tab selectors, or mutually exclusive option selectors in WinUI applications. Essential for segment-based navigation, filter toggles, view switchers, button groups with single selection, or any scenario requiring mutually exclusive selection from 2+ options in WinUI.
Ships in Syncfusion WinUI Controls. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill when the user needs to:
Always apply this skill when the user mentions: segmented control, segment picker, option selector, filter bar, view switcher, tab selector, mutually exclusive buttons, or segment-based navigation in WinUI applications.
SfSegmentedControl is a Syncfusion WinUI control that provides a simple way to choose from a linear set of two or more segments, each functioning as a mutually exclusive option. It offers a clean alternative to radio buttons or tabs with built-in slide animation, custom styling, and theme support.
Namespace: Syncfusion.UI.Xaml.Editors
NuGet Package: Syncfusion.Editors.WinUI
Platform: WinUI 3 Desktop (.NET 5+, Windows App SDK 1.0+)
Key Advantage: Provides a modern, iOS-style segmented picker with slide animation, shadow effects, and extensive customization—ideal for compact option selection without complex UI.
📄 Read: references/getting-started.md
📄 Read: references/selection.md
📄 Read: references/selection-styling.md
📄 Read: references/disable-items.md
📄 Read: references/ui-customization.md
📄 Read: references/custom-templates.md
📄 Read: references/themes.md
<Window xmlns:syncfusion="using:Syncfusion.UI.Xaml.Editors">
<Grid>
<syncfusion:SfSegmentedControl
x:Name="segmentedControl"
HorizontalAlignment="Center"
VerticalAlignment="Center"
SelectedIndex="0">
<x:String>Day</x:String>
<x:String>Week</x:String>
<x:String>Month</x:String>
<x:String>Year</x:String>
</syncfusion:SfSegmentedControl>
</Grid>
</Window>
// ViewModel
public class SegmentedViewModel
{
public ObservableCollection<PeriodModel> Periods { get; set; }
public SegmentedViewModel()
{
Periods = new ObservableCollection<PeriodModel>
{
new PeriodModel { Name = "Day" },
new PeriodModel { Name = "Week" },
new PeriodModel { Name = "Month" },
new PeriodModel { Name = "Year" }
};
}
}
public class PeriodModel
{
public string Name { get; set; }
}
<syncfusion:SfSegmentedControl
ItemsSource="{Binding Periods}"
DisplayMemberPath="Name"
SelectedIndex="2"/>
<syncfusion:SfSegmentedControl SelectedIndex="0" SelectionChanged="ViewMode_Changed">
<x:String>List</x:String>
<x:String>Grid</x:String>
<x:String>Timeline</x:String>
</syncfusion:SfSegmentedControl>
private void ViewMode_Changed(object sender, SegmentSelectionChangedEventArgs e)
{
string selectedMode = e.NewValue as string;
UpdateViewMode(selectedMode);
}
When to use: Switching between different display modes or layouts.
<syncfusion:SfSegmentedControl
ItemsSource="{Binding FilterOptions}"
DisplayMemberPath="Label"
SelectedIndex="{Binding SelectedFilterIndex, Mode=TwoWay}"/>
When to use: Filtering data by category with visible selection state.
<syncfusion:SfSegmentedControl ItemsSource="{Binding Items}">
<syncfusion:SfSegmentedControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Path Data="{Binding Icon}" Fill="{Binding IconColor}" Width="16" Height="16"/>
<TextBlock Text="{Binding Name}" Margin="6,0,0,0"/>
</StackPanel>
</DataTemplate>
</syncfusion:SfSegmentedControl.ItemTemplate>
</syncfusion:SfSegmentedControl>
When to use: Segments with icons or images for better visual recognition.
segmentedControl.SetItemEnabled(2, false); // Disable "Premium" option
segmentedControl.SetItemEnabled(3, false); // Disable "Enterprise" option
When to use: Conditionally disabling options based on user permissions or app state.
<syncfusion:SfSegmentedControl SelectedIndex="1">
<syncfusion:SfSegmentedControl.SelectedSegmentStyle>
<Style TargetType="syncfusion:SelectedSegmentBorder">
<Setter Property="Background" Value="#6C58EA"/>
<Setter Property="HasShadow" Value="True"/>
<Setter Property="ShadowColor" Value="#6C58EA"/>
<Setter Property="CornerRadius" Value="8"/>
</Style>
</syncfusion:SfSegmentedControl.SelectedSegmentStyle>
</syncfusion:SfSegmentedControl>
When to use: Adding visual depth and modern appearance to selected segments.
<syncfusion:SfSegmentedControl
SelectionAnimationType="None"
SelectedIndex="0">
<x:String>Option 1</x:String>
<x:String>Option 2</x:String>
<x:String>Option 3</x:String>
</syncfusion:SfSegmentedControl>
When to use: When slide animation feels too slow or distracting for rapid selections.
| Property | Type | Default | Description |
|---|---|---|---|
ItemsSource | IEnumerable | null | Collection of items to display as segments. |
DisplayMemberPath | string | null | Property path to display from business objects. |
ItemTemplate | DataTemplate | null | Custom template for rendering each segment item. |
SelectedIndex | int | 0 | Index of the currently selected segment (0-based). |
SelectedItem | object | null | Currently selected item from ItemsSource. |
SelectionAnimationType | SegmentSelectionAnimationType | Slide | Animation type (Slide or None) for selection transitions. |
SelectedSegmentStyle | Style | Default | Style for the selected segment border (SelectedSegmentBorder target). |
ItemContainerStyle | Style | Default | Style for each SfSegmentedItem container. |
ItemTemplateSelector | DataTemplateSelector | null | Selector for conditional item templates. |
ItemContainerStyleSelector | StyleSelector | null | Selector for conditional item styles. |
BorderThickness | Thickness | 1 | Border thickness of the control. |
ItemBorderThickness | Thickness | 0,0,1,0 | Border thickness between segment items. |
CornerRadius | CornerRadius | 0 | Corner radius of the control. |
BorderBrush | Brush | Default | Border color of the control. |
| Event | Description |
|---|---|
SelectionChanged | Fired when selection changes. Provides NewValue and OldValue in SegmentSelectionChangedEventArgs. |
| Method | Description |
|---|---|
SetItemEnabled(int index, bool isEnabled) | Enables or disables a segment item at the specified index. |
Best Approach: Use string items or DisplayMemberPath with SelectionChanged event handler.
Best Approach: Bind to ObservableCollection, use SelectedIndex with two-way binding.
Best Approach: Use SelectionChanged to update app settings immediately.
Best Approach: Use with custom ItemTemplate for icons, disable animation for instant switching.
Best Approach: Enable shadow effects, use custom colors matching dashboard theme.
Item Count: Best for 2-7 segments. More items may require scrolling or alternative control.
Selection Handling: Use SelectionChanged event for immediate reactions. Bind SelectedIndex for MVVM.
Disabled Items: Use SetItemEnabled() after ItemsSource is set. Call in Loaded event if binding to ViewModel.
Custom Styling: Set ItemContainerStyle for uniform spacing. Use SelectedSegmentStyle for selection appearance.
Animation: Slide animation (default) provides smooth transitions. Use None for instant selection in forms.
Keyboard Support: Arrow keys navigate, Enter selects. Ensure TabIndex is set for proper focus flow.
Theme Support: Use theme keys in Resources for consistent Light/Dark theme appearance.
ItemTemplate: Use for icons, images, or complex layouts. Keep templates simple for performance.
Border Customization: Set ItemBorderThickness="0" for seamless segments. Use BorderThickness for outer border.
CornerRadius: Match control and item CornerRadius for consistent rounded appearance.
references/custom-templates.md (opens in a new tab)references/disable-items.md (opens in a new tab)references/getting-started.md (opens in a new tab)references/selection-styling.md (opens in a new tab)references/selection.md (opens in a new tab)references/themes.md (opens in a new tab)references/ui-customization.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-winui39 skills in this plugin
/syncfusion-winui-ai-assistviewGuide for implementing the Syncfusion WinUI AI AssistView control for creating AI chat interfaces and conversational UI. Use this skill when implementing AI chat interfaces, AI assistants, conversational UI, or chatbots in WinUI applications. Essential for creating AI-powered chat experiences, integrating AI services, displaying AI responses, showing typing indicators, providing AI suggestions, managing conversation history with a navigation view, customizing empty states with EmptyView/EmptyViewTemplate, or setting input placeholder text in conversational interfaces with AI services in WinUI./syncfusion-winui-autocompleteGuide implementation of the Syncfusion WinUI AutoComplete control (SfAutoComplete) for creating searchable dropdowns with single or multiple selection, filtering suggestions, and customizable token display. Use this skill when implementing search-as-you-type functionality, autocomplete dropdowns with multi-select, tagging systems with token/chip display, or filtered suggestion boxes in WinUI applications./syncfusion-winui-avatar-viewGuide for implementing the Syncfusion WinUI AvatarView control to display user avatars and profile pictures. Use this when implementing user profiles, contact lists, or chat interfaces requiring visual user representation in WinUI applications. This skill covers initials display, image avatars, group avatars, and pre-defined avatar characters./syncfusion-winui-badgeGuide implementation of the Syncfusion WinUI Badge control (SfBadge) for displaying notification badges and status indicators. Use this skill when working with badge notifications, unread count badges, BadgeContainer, or notification overlays in WinUI applications. Covers shapes, colors, positioning, alignment, animations, and customization patterns./syncfusion-winui-barcodeImplement Syncfusion WinUI Barcode (SfBarcode) control to generate and display machine-readable barcodes in desktop applications. Use this when working with barcodes, QR codes, or product labeling systems. This skill covers symbology types (DataMatrix, Code39, Code128, Codabar, UPC), barcode customization, text alignment, rotation, and visual encoding for WinUI applications./syncfusion-winui-busy-indicatorGuide for implementing the Syncfusion WinUI BusyIndicator control to display loading indicators and progress status. Use this skill when implementing loading indicators, showing progress status, indicating background operations, or creating waiting screens in WinUI applications. Essential for async data loading, file operations, API calls, and any scenario requiring user notification during processing tasks.