WPFDevelopers Getting Started

June 20, 2026 ยท View on GitHub

Get started with WPFDevelopers controls in your WPF project in three steps.

Supported .NET Versions

WPFDevelopers covers the full spectrum from .NET Framework 4.0 to .NET 10:

Framework FamilySpecific Versions
.NET Frameworknet40, net45, net451, net452, net46, net461, net462, net47, net471, net472, net48, net481
.NET Corenetcoreapp3.0, netcoreapp3.1
.NET 5+net5.0-windows, net6.0-windows, net7.0-windows, net8.0-windows, net9.0-windows, net10.0-windows

Requirements

  • Visual Studio 2026
  • .NET Framework 4.0 or later / .NET Core 3.0 or later

Step 1: Install the NuGet Package

Install via NuGet Package Manager or Package Manager Console:

Install-Package WPFDevelopers

Note: For the latest features, use the preview package:

Install-Package WPFDevelopers -Pre

Or in Visual Studio: right-click your project โ†’ Manage NuGet Packages โ†’ search WPFDevelopers โ†’ Install.


Step 2: Configure App.xaml

Add the WD namespace and theme resources in App.xaml:

<Application x:Class="YourApp.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <!-- 1. Theme must be imported first -->
                <ResourceDictionary Source="pack://application:,,,/WPFDevelopers;component/Themes/Theme.xaml" />
                <!-- 2. wd:Resources must come AFTER Theme.xaml -->
                <wd:Resources />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

Theme Configuration

<wd:Resources /> supports the following modes:

ConfigurationEffect
<wd:Resources />Default Light theme (follows system Light/Dark on Windows 10+)
<wd:Resources Theme="Light" />Fixed light theme
<wd:Resources Theme="Dark" />Fixed dark theme
<wd:Resources Color="Fuchsia" />Custom theme color

Important: wd:Resources must be placed after Theme.xaml in MergedDictionaries, otherwise the theme will not load correctly.


Step 3: Use Controls in XAML

Declare the namespace in any XAML file:

xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"

Then use WD controls:

<Window x:Class="YourApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
        Title="My App" Width="800" Height="600">
    <Grid>
        <wd:BallLoading Width="100" IsLoading="True" />
    </Grid>
</Window>

Three Usage Patterns

1. Direct WD Controls

<!-- Loading animation -->
<wd:BallLoading Width="100" IsLoading="{Binding IsLoading}" />

<!-- Drawer panel -->
<wd:Drawer x:Name="DrawerTop" Position="Top">
    <wd:Drawer.Header><TextBlock Text="Title" FontSize="16" /></wd:Drawer.Header>
    <wd:Drawer.Content><TextBlock Text="Content" /></wd:Drawer.Content>
</wd:Drawer>

<!-- Multi-select ComboBox -->
<wd:MultiSelectComboBox ItemsSource="{Binding Items}" ShowType="Tag">
    <wd:MultiSelectComboBoxItem Content="Option 1" />
    <wd:MultiSelectComboBoxItem Content="Option 2" />
</wd:MultiSelectComboBox>

<!-- Step wizard -->
<wd:Step StepIndex="1">
    <wd:StepItem Content="Step 1" />
    <wd:StepItem Content="Step 2" />
    <wd:StepItem Content="Step 3" />
</wd:Step>

<!-- Carousel -->
<wd:Carousel ItemsSource="{Binding CarouselItems}" />

<!-- Radar chart -->
<wd:ChartRadar Datas="{Binding RadarDatas}" />

<!-- Bar chart -->
<wd:ChartBar Datas="{Binding BarDatas}" />

<!-- Line chart -->
<wd:ChartLine Datas="{Binding LineDatas}" />

<!-- Pie chart (LiveCharts-style) -->
<wd:ChartPie Datas="{Binding PieDatas}" />

<!-- Dashboard gauge (NuGet version) -->
<wd:Gauge Value="75" MaxValue="100" />

<!-- Circular progress bar -->
<wd:CircleProgressBar Value="75" />

2. Attached Properties on Standard WPF Controls

<!-- Badge notification -->
<Button wd:Badge.IsShow="True" wd:Badge.Text="new" Content="Messages" />

<!-- Button loading state -->
<Button wd:Loading.IsShow="True" wd:Loading.LoadingType="Normal" Content="Submit" />

<!-- TextBox watermark + clear button -->
<TextBox wd:ElementHelper.Watermark="Enter username" wd:ElementHelper.IsClear="True" />

<!-- PasswordBox monitoring -->
<PasswordBox wd:PasswordBoxHelper.IsMonitoring="True" wd:ElementHelper.Watermark="Password" />

<!-- DatePicker with time -->
<DatePicker wd:DatePickerHelper.ShowTime="True" />

<!-- Panel spacing -->
<WrapPanel wd:PanelHelper.Spacing="10">
    <Button Content="Button 1" />
    <Button Content="Button 2" />
</WrapPanel>

<!-- Corner radius -->
<Button wd:ElementHelper.CornerRadius="5" Content="Rounded" />
<TextBox wd:ElementHelper.CornerRadius="3" />
<DataGrid wd:ElementHelper.CornerRadius="3" />

<!-- Striped progress bar -->
<ProgressBar wd:ElementHelper.IsStripe="True" Value="80" />

<!-- Closable TabItem -->
<TabItem wd:ElementHelper.IsClear="True" Header="Closable Tab" />

<!-- TreeView scroll animation -->
<TreeView wd:TreeViewHelper.IsScrollAnimation="true" />

3. Static Resource Styles

<!-- Normal button -->
<Button Style="{StaticResource WD.NormalButton}" Content="Normal" />

<!-- Primary buttons (various themes) -->
<Button Style="{StaticResource WD.PrimaryButton}" Content="Primary" />
<Button Style="{StaticResource WD.SuccessPrimaryButton}" Content="Success" />
<Button Style="{StaticResource WD.WarningPrimaryButton}" Content="Warning" />
<Button Style="{StaticResource WD.DangerPrimaryButton}" Content="Danger" />

<!-- Default buttons (various themes) -->
<Button Style="{StaticResource WD.SuccessDefaultButton}" Content="Success" />
<Button Style="{StaticResource WD.WarningDefaultButton}" Content="Warning" />
<Button Style="{StaticResource WD.DangerDefaultButton}" Content="Danger" />

Common Theme Resources

WD provides a set of theme resources you can reference in XAML:

Resource KeyTypeDescription
WD.PrimaryBrushSolidColorBrushPrimary color
WD.SuccessBrushSolidColorBrushSuccess color
WD.WarningBrushSolidColorBrushWarning color
WD.DangerBrushSolidColorBrushDanger color
WD.InfoSolidColorBrushSolidColorBrushInfo color
WD.LightBrushSolidColorBrushLight color
WD.CircularSingularSolidColorBrushSolidColorBrushCircular accent color
WD.BackgroundBrushSolidColorBrushBackground color
WD.PrimaryTextBrushSolidColorBrushPrimary text color
WD.WarningGeometryGeometryWarning icon

Complete Control Catalog

Important: Controls marked ๐ŸŸก Sample-only are defined in WPFDevelopers.Samples.Shared/Controls/ and are NOT part of the NuGet package (wd: namespace). They are only available in the sample project. All other controls can be used directly via the wd: prefix after NuGet installation.

Windows & Navigation

ControlSourceExample FileDescription
wd:WindowNuGetMainWindow.xamlCustom window (ToolWindow / NoneTitleBar / Normal / HighTitleBar)
wd:NotifyIconNuGetNotifyIconExample.xamlSystem tray icon
wd:DrawerMenuNuGetDrawerMenuExample.xamlWin10-style drawer navigation
wd:NavMenu3DNuGetNavMenu3DExample.xaml3D animated navigation menu
wd:NavScrollPanelNuGetNavScrollPanelExample.xamlWin10 settings-style nav panel
๐ŸŸก TransitionPanelSample-onlyTransitionPanelExample.xamlTransition animation panel
wd:DrawerNuGetDrawerExample.xamlSlide-out panel (Top/Bottom/Left/Right)
wd:MaskNuGetMaskExample.xamlModal overlay
wd:AcrylicBlurNuGetAcrylicBlurExample.xamlAcrylic blur window
๐ŸŸก TaskbarItemInfoSample-onlyTaskbarItemInfoExample.xamlTaskbar badge

Basic Controls & Styles

ControlExample FileDescription
TextBoxBasicControlsExample.xamlTextBox (watermark / clear button / corner radius)
PasswordBoxBasicControlsExample.xamlPasswordBox (watermark / clear / monitor / plain text toggle)
ComboBoxBasicControlsExample.xamlComboBox (watermark / editable / corner radius)
CheckBoxBasicControlsExample.xamlCheckbox
RadioButtonBasicControlsExample.xamlRadio button
ToggleButtonBasicControlsExample.xamlToggle button
SliderBasicControlsExample.xamlSlider (horizontal / vertical)
ProgressBarBasicControlsExample.xamlProgress bar (striped / indeterminate / vertical)
DataGridBasicControlsExample.xamlData grid (row header selection / template columns / grid lines)
ListBoxBasicControlsExample.xamlList box
ListViewBasicControlsExample.xamlList view (GridView)
TreeViewBasicControlsExample.xamlTree view (scroll animation)
ExpanderBasicControlsExample.xamlExpander (4 directions)
GroupBoxBasicControlsExample.xamlGroup box
TabControlBasicControlsExample.xamlTab control (4 directions / closable)
MenuBasicControlsExample.xamlMenu bar
wd:SplitButtonNuGetSplitButtonExample.xaml
CalendarBasicControlsExample.xamlCalendar
DatePickerBasicControlsExample.xamlDate picker (with time selection)

Input Controls

ControlSourceExample FileDescription
wd:ColorPickerNuGetColorPickerExample.xamlColor picker
wd:TimePickerNuGetTimePickerExample.xamlTime picker
wd:DateRangePickerNuGetDateRangePickerExample.xamlDate range picker
wd:NumericBoxNuGetNumericBoxExample.xamlNumeric input
wd:IPEditBoxNuGetIPEditBoxExample.xamlIP address input
wd:MultiSelectComboBoxNuGetMultiSelectComboBoxExample.xamlMulti-select combo box
๐ŸŸก MultiSelectSearchComboBoxSample-onlyMultiSelectSearchComboBoxExample.xamlSearchable multi-select combo box
wd:PasswordNuGetPasswordExample.xamlPassword show/hide toggle
wd:VerifyCodeNuGetVerifyCodeExample.xamlCAPTCHA drawing
๐ŸŸก RoundPickerSample-onlyRoundPickerExample.xamlCircular color picker
wd:RulerControlNuGetRulerControlExample.xamlRuler control
๐ŸŸก SelectorSample-onlySelectorExample.xamlSelector control
wd:DialNuGetDialExample.xamlDial pad
wd:GestureUnlockNuGetGestureUnlockExample.xamlGesture pattern unlock
wd:SvgViewerNuGetSvgViewerExample.xamlSVG viewer
wd:OtpBoxNuGetOtpBoxExample.xamlOTP verification code input (auto-jump / backspace / paste)

Loading Animations

ControlSourceExample FileDescription
wd:RingLoadingNuGetRingLoadingExample.xamlRing loading animation
wd:BallLoadingNuGetBallLoadingExample.xamlBouncing ball animation
๐ŸŸก StreamerLoadingSample-onlyStreamerLoadingExample.xamlStreamer animation
wd:WaitLoadingNuGetWaitLoadingExample.xamlWait animation
wd:CycleLoadingNuGetCycleLoadingExample.xamlCycle animation
wd:RollLoadingNuGetRollLoadingExample.xamlRolling animation
wd:Loading (attached)NuGetLoadingExample.xamlButton/control loading state

Charts & Data Visualization

ControlSourceExample FileDescription
wd:ChartRadarNuGetChartRadarExample.xamlRadar chart
wd:ChartBarNuGetChartBarExample.xamlBar chart
wd:ChartLineNuGetChartLineExample.xamlLine chart
wd:ChartPieNuGetChartPieExample.xamlPie chart
๐ŸŸก DashboardSample-onlyDashboardExample.xamlDashboard gauge (tick marks follow progress)
๐ŸŸก PieControlSample-onlyPieControlExample.xamlPie chart statistics
wd:GaugeNuGetGaugeExample.xamlGauge control
๐ŸŸก LineChartSample-onlyLineChartExample.xamlLine chart (alternate implementation)
wd:CircleProgressBarNuGetCircleProgressBarExample.xamlCircular progress bar
wd:StepNuGetStepExample.xamlStep wizard
wd:BreadCrumbBarNuGetBreadCrumbBarExample.xamlBreadcrumb navigation
wd:PaginationNuGetPaginationExample.xamlPagination control
๐ŸŸก TimeLineControlSample-onlyTimeLineExample.xamlTimeline (Gitee-style)
wd:ThermometerNuGetThermometerExample.xamlThermometer
wd:DataGridFilterNuGetDataGridFilterExample.xamlDataGrid column filter engine

Layout & Panels

ControlSourceExample FileDescription
wd:CarouselNuGetCarouselExample.xamlCarousel (auto-play / dot indicators / arrows / click navigation)
wd:FocusCarouselNuGetFocusCarouselExample.xamlEmphasizer carousel (3D flip + zoom effect)
wd:CardCarouselNuGetCardCarouselExample.xamlMaster carousel (multi-layer overlay animation)
wd:CircleMenuNuGetCircleMenuExample.xamlCircular menu
wd:SixGridViewNuGetSixGirdViewExample.xamlSix-column grid layout
wd:WaterfallPanelNuGetWaterfallPanelExample.xamlWaterfall / masonry panel
wd:VirtualizingWrapPanelNuGetVirtualizingWrapPanelExample.xamlVirtualizing WrapPanel
๐ŸŸก TransformLayoutSample-onlyTransformLayoutExample.xamlDraggable, resizable, rotatable control
wd:DrapViewNuGetDrapViewExample.xamlDrag-and-drop view
wd:Spacing (attached)NuGetSpacingExample.xamlPanel child spacing
wd:PanningItemsNuGetPanningItemsExample.xamlPanning control (touch swipe)
๐ŸŸก ScrollViewerAnimationSample-onlyScrollViewerAnimationExample.xamlAnimated scrollbar
wd:IconicThumbnailNuGetIconicThumbnailExample.xamlIconic thumbnail

Animation & Effects

ControlSourceExample FileDescription
wd:BreatheLightNuGetBreatheLightExample.xamlBreathing light animation
wd:SpotLightNuGetSpotLightExample.xamlSpotlight effect
wd:EdgeLightNuGetEdgeLightExample.xamlEdge marquee light
๐ŸŸก RainbowButtonsSample-onlyRainbowButtonsExample.xamlRainbow buttons
wd:ShakeNuGetShakeExample.xamlWindow shake
๐ŸŸก BubblleControlSample-onlyBubblleControlExample.xamlBubble animation
wd:StarrySkyNuGetStarrySkyExample.xamlStarry sky animation
๐ŸŸก SnowCanvasSample-onlySnowCanvasExample.xamlChristmas tree & snow canvas
๐ŸŸก SpeedRocketsSample-onlySpeedRocketsExample.xamlSpeed rocket animation
๐ŸŸก CountdownTimerSample-onlyCountdownTimerExample.xamlCountdown timer animation
๐ŸŸก NumberCardSample-onlyNumberCardExample.xaml3D flip countdown cards
wd:AnimationGridNuGetAnimationGridExample.xamlAnimation grid
๐ŸŸก LogoAnimationSample-onlyLogoAnimationExample.xamlLogin logo animation
๐ŸŸก SongWordsSample-onlySongWordsExample.xamlLyrics scroll animation
wd:AnimationAudioNuGetAnimationAudioExample.xamlAudio waveform visualization
๐ŸŸก BarrageSample-onlyBarrageExample.xamlDanmaku / barrage control
๐ŸŸก CanvasHandWritingSample-onlyCanvasHandWritingExample.xamlSmooth canvas handwriting
๐ŸŸก DrawingSample-onlyDrawingExample.xamlFreehand drawing
๐ŸŸก DrawPrizeSample-onlyDrawPrizeExample.xamlLottery wheel

Effects & Filters

ControlSourceExample FileDescription
wd:GrayscaleEffectNuGetGrayscaleEffectExample.xamlGrayscale filter effect (adjustable intensity)

Media & Image Processing

ControlSourceExample FileDescription
wd:ScreenCutNuGetScreenCutExample.xamlScreen capture (pen / arrow annotation)
wd:CropImageNuGetCropImageExample.xamlImage cropping
wd:CropAvatarNuGetCropAvatarExample.xamlAvatar cropping selector
๐ŸŸก CropControlSample-onlyCropControlExample.xamlImage nine-grid cutter
๐ŸŸก CutImageSample-onlyCutImageExample.xamlUser avatar cropping solution
wd:MagnifierNuGetMagnifierExample.xamlMagnifier

Notifications & Messages

ControlSourceExample FileDescription
wd:Badge (attached)NuGetBadgeExample.xamlBadge notification
wd:ToastNuGetToastExample.xamlToast message popup
wd:TagNuGetTagExample.xamlTag control
wd:PathIconNuGetPathIconExample.xamlVector path icon
wd:AllPathIconNuGetAllPathIconExample.xamlBuilt-in icon browser
MessageBox (static class)NuGetMessageBoxExample.xamlMessage dialog

Other Controls

ControlSourceExample FileDescription
๐ŸŸก ZooSemySample-onlyZooSemyExample.xamlSkeuomorphic rotary knob (volume)
๐ŸŸก OtherControlSample-onlyOtherControlExample.xamlTorch & other fun controls
๐ŸŸก DesktopSample-onlyDesktopBackground.xamlDynamic desktop wallpaper
๐ŸŸก AMapSample-onlyBingAMapExample.xamlMap integration (Bing / AutoNavi)
๐ŸŸก LoginWindowSample-onlyLoginExample.xamlLogin window template
๐ŸŸก ChatEmojiSample-onlyChatEmojiExample.xamlEmoji + text chat

MessageBox Usage Tutorial

MessageBox is a static message dialog class provided by WPFDevelopers, designed as a drop-in replacement for System.Windows.MessageBox with a more polished and customizable appearance.

Note: MessageBox is a static class, not a XAML control. It can only be called from C# code.

Import the Namespace

To avoid conflicts with System.Windows.MessageBox, use an alias:

using MessageBox = WPFDevelopers.Controls.MessageBox;

Method Signatures

MessageBox.Show() provides 5 overloads:

// 1. Message text only (default OK button, no icon)
MessageBoxResult Show(string messageBoxText, Window owner = null, double? buttonRadius = null, bool isDefault = true)

// 2. Message text + caption
MessageBoxResult Show(string messageBoxText, string caption, Window owner = null, double? buttonRadius = null, bool isDefault = true)

// 3. Message text + caption + buttons
MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, Window owner = null, double? buttonRadius = null, bool isDefault = true)

// 4. Message text + caption + icon
MessageBoxResult Show(string messageBoxText, string caption, MessageBoxImage icon, Window owner = null, double? buttonRadius = null, bool isDefault = true)

// 5. Message text + caption + buttons + icon (full signature)
MessageBoxResult Show(string messageBoxText, string caption, MessageBoxButton button, MessageBoxImage icon, Window owner = null, double? buttonRadius = null, bool isDefault = true)

Parameters

ParameterTypeDefaultDescription
messageBoxTextstringโ€”Message content
captionstringโ€”Dialog title
buttonMessageBoxButtonOKButton set: OK / OKCancel / YesNo / YesNoCancel
iconMessageBoxImageNoneIcon type: Information / Warning / Error / Question
ownerWindownullParent window. When provided, the dialog centers on the owner with an overlay mask
buttonRadiusdouble?nullButton corner radius in pixels. When null, auto-detects OS: Windows 11 defaults to 4px, Windows 10 defaults to 0px
isDefaultbooltrueWhether the first button is the default button (triggered by Enter key)

Icon and Color Mapping

MessageBoxImageIconColor
InformationInfo iconSuccess (green)
WarningWarning iconWarning (orange)
ErrorError iconDanger (red)
QuestionQuestion iconPrimary (blue)

Usage Examples

1. Information Dialog

// File deleted successfully, with rounded buttons
MessageBox.Show("File deleted successfully.", "Message", MessageBoxButton.OK, MessageBoxImage.Information, buttonRadius: 4);

2. Warning Dialog

// Uses default OK button
MessageBox.Show("Performing this action may cause the file to become inaccessible!", "Warning", MessageBoxImage.Warning);

3. Error Dialog

MessageBox.Show("The file does not exist.", "Error", MessageBoxImage.Error);

4. Confirmation Dialog (with Result Handling)

var result = MessageBox.Show("The file does not exist. Continue?", "Confirm", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);

switch (result)
{
    case MessageBoxResult.Yes:
        // User clicked "Yes"
        break;
    case MessageBoxResult.No:
        // User clicked "No"
        break;
    case MessageBoxResult.Cancel:
        // User clicked "Cancel" or closed the dialog
        break;
}

5. With Owner Window (with Overlay Mask)

// When owner is passed, the dialog centers on the parent window and shows an overlay mask
MessageBox.Show("Operation successful!", "Info", MessageBoxButton.OK, MessageBoxImage.Information, owner: this, buttonRadius: 4);

Interaction Behavior

  • Close methods: Click the close button (top-right), press Escape, or click any button
  • Owner window: When owner is provided, the dialog centers on the parent window and displays a mask overlay. Without an owner, it auto-detects the current window or centers on screen
  • Button text: Automatically localized via LanguageManager (follows system language)

SplitButton Usage Tutorial

SplitButton is a split button control provided by WPFDevelopers. The left side is a clickable main button area, and the right side is a dropdown toggle button. It supports both text options and rich content options with icons.

Basic Usage (ItemsSource Data Binding)

<wd:SplitButton
    Width="150"
    Content="File"
    ItemsSource="{Binding MenuItems}"
    SelectionChanged="SplitButton_SelectionChanged" />
// ViewModel or Code-behind
public ObservableCollection<string> MenuItems { get; } = new ObservableCollection<string>
{
    "Save in PDF",
    "Save in Word",
    "Save in Excel",
    "Save in Image"
};

private void SplitButton_SelectionChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
    // e.NewValue is the selected item
}

Default Style (Border + Transparent Background)

<wd:SplitButton Width="150" Content="File" ItemsSource="{Binding MenuItems}" />

Primary Style (Solid Primary Color Background)

<wd:SplitButton
    Width="150"
    Content="File"
    ItemsSource="{Binding MenuItems}"
    Style="{StaticResource WD.SplitButtonPrimary}" />

Custom Color + XAML Children (Supports MenuItem with Icons)

<wd:SplitButton
    Width="150"
    Background="{StaticResource WD.SuccessBrush}"
    BorderBrush="{StaticResource WD.SuccessBrush}"
    Content="File"
    Foreground="White">
    <MenuItem Header="Copy">
        <MenuItem.Icon>
            <wd:PathIcon Kind="Copy" />
        </MenuItem.Icon>
    </MenuItem>
    <MenuItem Header="Paste" />
    <MenuItem Header="Cut" />
</wd:SplitButton>

Key Properties

PropertyTypeDefaultDescription
ContentobjectnullMain button display content
ItemsSourceobjectnullDropdown menu data source (IEnumerable)
IsDropDownOpenboolfalseWhether dropdown is open (two-way binding)
ContextMenuStyleStylenullCustom ContextMenu style

Events

EventDescription
ClickFired when the main button area is clicked (clicking ToggleButton does NOT fire this)
SelectionChangedFired when a dropdown menu item is selected

Available Styles

Style KeyDescription
WD.SplitButton (default)Border + transparent background, border turns primary color on hover
WD.SplitButtonPrimaryNo border + solid primary color background + white text

Interaction Behavior

ActionBehavior
Click main button areaFires Click event
Click ToggleButtonExpands/collapses dropdown menu
Click menu itemButton Content updates to selected item, fires SelectionChanged
Click outside menuAutomatically closes dropdown

Carousel is a carousel control provided by WPFDevelopers, supporting auto-play, dot indicators, arrow navigation, click navigation, and more.

Basic Usage (XAML Declaration)

<wd:Carousel
    Width="400" Height="200"
    AutoPlay="True"
    AutoPlayInterval="0:0:4"
    ShowArrows="True"
    ItemClick="Carousel_ItemClick">
    <Border Background="#722ed1">
        <TextBlock Text="Slide 1" Foreground="White" FontSize="24" />
    </Border>
    <Border Background="#eb2f96">
        <TextBlock Text="Slide 2" Foreground="White" FontSize="24" />
    </Border>
    <Border Background="#1890ff">
        <TextBlock Text="Slide 3" Foreground="White" FontSize="24" />
    </Border>
</wd:Carousel>

Data Binding Usage (MVVM)

<wd:Carousel
    ItemsSource="{Binding ImagePaths}"
    DisplayMemberPath="URL"
    AutoPlay="True"
    ItemClickCommand="{Binding CarouselClickCommand}" />
// Data model
public class CarouselSlideModel
{
    public string Title { get; set; }
    public string URL { get; set; }
}

// ViewModel
public ObservableCollection<CarouselSlideModel> ImagePaths { get; set; }

public ICommand CarouselClickCommand => new RelayCommand(param =>
{
    if (param is CarouselSlideModel model)
    {
        Toast.Push($"Clicked image - {model.Title}", ToastImage.Success, true);
    }
});

Key Properties

PropertyTypeDefaultDescription
ItemsSourceIEnumerablenullData source
SelectedIndexint0Current selected item index
SelectedItemobjectnullCurrent selected item
AutoPlayboolfalseEnable auto-play
AutoPlayIntervalTimeSpan3 secondsAuto-play interval
AnimationDurationdouble0.5Transition animation duration (seconds)
ShowDotsbooltrueShow dot indicators
ShowArrowsbooltrueShow left/right arrows
ItemTemplateDataTemplatenullData template
DisplayMemberPathstringnullDisplay member path (shows property value directly)

Events

EventDescription
ItemClickFired when a slide is clicked
SelectedItemChangedFired when selected item changes

Methods

MethodDescription
GoToNext()Navigate to next slide
GoToPrevious()Navigate to previous slide

FocusCarousel / CardCarousel

FocusCarousel

A carousel with 3D flip + zoom effects, where the center item is enlarged and highlighted:

<wd:FocusCarousel>
    <Image Source="pack://application:,,,/Images/photo1.jpg" />
    <Image Source="pack://application:,,,/Images/photo2.jpg" />
    <Image Source="pack://application:,,,/Images/photo3.jpg" />
</wd:FocusCarousel>

CardCarousel

A carousel with multi-layer overlay animation and auto-play/interval control:

<wd:CardCarousel AutoPlay="True" AutoPlayInterval="0:0:5">
    <Image Source="pack://application:,,,/Images/photo1.jpg" />
    <Image Source="pack://application:,,,/Images/photo2.jpg" />
    <Image Source="pack://application:,,,/Images/photo3.jpg" />
</wd:CardCarousel>
PropertyTypeDefaultDescription
AutoPlayboolfalseEnable auto-play
AutoPlayIntervalTimeSpan0:0:3Playback interval (TimeSpan)

GrayscaleEffect Usage Tutorial

GrayscaleEffect is a pixel shader effect that converts any visual element to grayscale display, commonly used for global grayscale mode (e.g., memorial days).

Apply to a Single Control

<Image Source="photo.jpg">
    <Image.Effect>
        <wd:GrayscaleEffect Factor="1" />
    </Image.Effect>
</Image>

Apply to the Entire Window

<wd:Window>
    <wd:Window.Effect>
        <wd:GrayscaleEffect x:Name="grayscaleEffect" Factor="0" />
    </wd:Window.Effect>
</wd:Window>
// Enable grayscale
var animation = new DoubleAnimation
{
    To = 1,
    Duration = TimeSpan.FromMilliseconds(1000),
    EasingFunction = new SineEase { EasingMode = EasingMode.EaseOut }
};
grayscaleEffect.BeginAnimation(GrayscaleEffect.FactorProperty, animation);

// Disable grayscale
animation.To = 0;
grayscaleEffect.BeginAnimation(GrayscaleEffect.FactorProperty, animation);

Key Properties

PropertyTypeDefaultDescription
Factordouble0Grayscale intensity, 0 = original color, 1 = full grayscale
Brightnessdouble0Brightness adjustment

OtpBox OTP Input Control Usage Tutorial

OtpBox is a control designed for OTP (One-Time Password) input scenarios, supporting auto-focus jump, backspace retreat, paste fill, and more.

Basic Usage

<wd:OtpBox Length="6" Completed="OtpBoxCompleted" />

MVVM Binding

<wd:OtpBox
    Length="6"
    Value="{Binding OtpCode, Mode=TwoWay}"
    CompletedCommand="{Binding VerifyCommand}" />
// Event approach
private void OtpBoxCompleted(object sender, RoutedEventArgs e)
{
    var otpBox = e.OriginalSource as OtpBox;
    var pwd = otpBox?.Value ?? string.Empty;

    if (pwd != _otpPassword)
    {
        myOtpBox.State = ControlState.Error;
        return;
    }

    myOtpBox.State = ControlState.Success;
}

// Command approach
public ICommand CompletedCommand => new RelayCommand(param =>
{
    var pwd = param.ToString();
    // Validation logic...
});

Key Properties

PropertyTypeDefaultDescription
Lengthint4Number of OTP digits
Valuestring""Current value (supports two-way binding)
StateControlStateNoneValidation state (None/Success/Error)
CompletedCommandICommandnullCommand executed on completion

Events

EventDescription
CompletedFired when all digits are filled

Interaction Features

ActionBehavior
Enter a digitAuto-jump to next input box
Backspace (empty box)Jump to previous box and delete last character
Ctrl+V PasteAuto-fill digit by digit, filter non-numeric characters
Arrow keys โ† โ†’Switch between input boxes
Enter / TabJump to next input box
Error stateAuto-clear and refocus after 1.5 seconds
Success stateAuto-reset to default state after 1.5 seconds

Full Sample Project

If you prefer not to configure from scratch, reference the sample project in this repository:

src/WPFDevelopers.Samples.Shared/
โ”œโ”€โ”€ App.xaml                              # App entry point & theme config
โ”œโ”€โ”€ ExampleViews/                         # Full control example pages
โ”‚   โ”œโ”€โ”€ MainWindow.xaml                   # Main window (left menu + right content)
โ”‚   โ”œโ”€โ”€ UsageGuide.xaml                   # Usage guide page
โ”‚   โ”œโ”€โ”€ UsageColor.xaml                   # Color usage guide
โ”‚   โ”œโ”€โ”€ BasicControlsExample.xaml         # Basic control examples
โ”‚   โ”œโ”€โ”€ Loading/                          # Loading animation series
โ”‚   โ”‚   โ”œโ”€โ”€ BallLoadingExample.xaml
โ”‚   โ”‚   โ”œโ”€โ”€ RingLoadingExample.xaml
โ”‚   โ”‚   โ”œโ”€โ”€ StreamerLoadingExample.xaml
โ”‚   โ”‚   โ”œโ”€โ”€ WaitLoadingExample.xaml
โ”‚   โ”‚   โ”œโ”€โ”€ CycleLoadingExample.xaml
โ”‚   โ”‚   โ””โ”€โ”€ RollLoadingExample.xaml
โ”‚   โ”œโ”€โ”€ DrawerMenu/                       # Drawer menu sub-pages
โ”‚   โ”‚   โ”œโ”€โ”€ HomePage.xaml
โ”‚   โ”‚   โ”œโ”€โ”€ EmailPage.xaml
โ”‚   โ”‚   โ””โ”€โ”€ EdgePage.xaml
โ”‚   โ”œโ”€โ”€ NavScrollPanel/                   # Nav settings panel sub-pages
โ”‚   โ”‚   โ”œโ”€โ”€ About.xaml
โ”‚   โ”‚   โ”œโ”€โ”€ PrivacySettings.xaml
โ”‚   โ”‚   โ”œโ”€โ”€ PlaybackSettings.xaml
โ”‚   โ”‚   โ”œโ”€โ”€ ShortcutKeys.xaml
โ”‚   โ”‚   โ””โ”€โ”€ DesktopLyrics.xaml
โ”‚   โ”œโ”€โ”€ LoginWindow/                      # Login window template
โ”‚   โ”‚   โ”œโ”€โ”€ CustomControl/
โ”‚   โ”‚   โ”œโ”€โ”€ CustomStyle/
โ”‚   โ”‚   โ””โ”€โ”€ LoginExample.xaml
โ”‚   โ”œโ”€โ”€ CropAvatar/                       # Avatar cropping
โ”‚   โ”‚   โ”œโ”€โ”€ CropAvatarExample.xaml
โ”‚   โ”‚   โ””โ”€โ”€ CropAvatarWindow.xaml
โ”‚   โ”œโ”€โ”€ NumberCard/                       # Countdown cards
โ”‚   โ”‚   โ”œโ”€โ”€ NumberCardExample.xaml
โ”‚   โ”‚   โ””โ”€โ”€ NumberCardControl.xaml
โ”‚   โ”œโ”€โ”€ SpeedRockets/                     # Rocket animation
โ”‚   โ”‚   โ”œโ”€โ”€ SpeedRocketsExample.xaml
โ”‚   โ”‚   โ””โ”€โ”€ SpeedRocketsMini.xaml
โ”‚   โ”œโ”€โ”€ ZooSemy/                          # Skeuomorphic knob
โ”‚   โ”‚   โ”œโ”€โ”€ ZooSemyExample.xaml
โ”‚   โ”‚   โ””โ”€โ”€ VolumeControl.xaml
โ”‚   โ”œโ”€โ”€ CanvasHandWriting/                # Handwriting
โ”‚   โ”‚   โ””โ”€โ”€ CanvasHandWritingExample.xaml
โ”‚   โ”œโ”€โ”€ Desktop/                          # Desktop wallpaper
โ”‚   โ”‚   โ”œโ”€โ”€ DesktopBackground.xaml
โ”‚   โ”‚   โ””โ”€โ”€ DesktopPlayVideo.xaml
โ”‚   โ”œโ”€โ”€ Passwrod/                         # Password controls
โ”‚   โ”‚   โ”œโ”€โ”€ PasswordExample.xaml
โ”‚   โ”‚   โ””โ”€โ”€ PasswordWithPlainText.xaml
โ”‚   โ”œโ”€โ”€ Map/                              # Map
โ”‚   โ”‚   โ””โ”€โ”€ BingAMapExample.xaml
โ”‚   โ”œโ”€โ”€ DrapView/                         # Drag view
โ”‚   โ”‚   โ””โ”€โ”€ DrapViewExample.xaml
โ”‚   โ””โ”€โ”€ ... (more example files)
โ”œโ”€โ”€ Controls/                             # Sample helper controls (CodeViewer, NavigateMenu, etc.)
โ”œโ”€โ”€ ViewModels/                           # Sample ViewModels
โ”œโ”€โ”€ Models/                               # Data models
โ”œโ”€โ”€ Helpers/MenuEnum.cs                   # All example category enum
โ””โ”€โ”€ Converts/                             # Value converters

Each example page includes a built-in code viewer (CodeViewer) that lets you inspect the corresponding XAML/C# source code directly.