ComboBox-Wpf
1.1.4
dotnet add package ComboBox-Wpf --version 1.1.4
NuGet\Install-Package ComboBox-Wpf -Version 1.1.4
<PackageReference Include="ComboBox-Wpf" Version="1.1.4" />
<PackageVersion Include="ComboBox-Wpf" Version="1.1.4" />
<PackageReference Include="ComboBox-Wpf" />
paket add ComboBox-Wpf --version 1.1.4
#r "nuget: ComboBox-Wpf, 1.1.4"
#:package ComboBox-Wpf@1.1.4
#addin nuget:?package=ComboBox-Wpf&version=1.1.4
#tool nuget:?package=ComboBox-Wpf&version=1.1.4
ComboBox-Wpf
A modern, customizable ComboBox control for WPF applications targeting .NET 8. This control provides a clean UI, custom scrollbars, flexible data binding, and easy styling, making it ideal for professional desktop applications.
Features
- Modern UI: Customizable appearance with support for custom fonts and colors.
- Data Binding: Supports
ItemsSource
,SelectedItem
,SelectedIndex
, andDisplayMemberPath
for MVVM-friendly binding. - Custom Scrollbars: Integrates custom scrollbar styles for a polished look.
- Popup Behavior: Dropdown popup closes automatically when clicking outside.
- Keyboard & Mouse Support: Full support for keyboard navigation and mouse interaction.
- Easy Theming: Change font, colors, and icons via XAML or code.
- Search/Filter: Set ShowSearchBar to true via XAML or code to search or filter list.
Installation
Install via NuGet Package Manager:
Install-Package ComboBox-Wpf
Or via .NET CLI:
dotnet add package ComboBox-Wpf
Usage
- Add Namespace
In your XAML file:
xmlns:combobox="clr-namespace:ComboBox_Wpf"
- Add the Control
<combobox:ComboBoxView x:Name="cmbWithMember" SelectedItem="{Binding MySelectedItem, Mode=TwoWay}" ItemsSource="{Binding MyItems}" ShowSearchBar="true" DisplayMemberPath="ItemName" />
Example
new Item() { ItemCode = "1", ItemName = "Test Item", Price = 30, Quantity = 1, Discount = 0.05 }
Item is model or class and if you want to use list of (Item) it in the ComboBox, you need to set the DisplayMemberPath to the property you want to display. For example, if you want to display the ItemName, set DisplayMemberPath="ItemName".
var stringList = new ObservableCollection<string> { "Test 1", "Test 2", "Test 3", "Test 4" }; If you use simple collection like string, int etc. you don't need to set DisplayMemberPath.
Customization
- Font:
Use theFontFamily
property. The includedInterMedium
font is available as a resource. - Colors:
SetBackgroundColor
andBorderBrushColor
for the header and popup. - Scrollbars:
Custom scrollbars are defined inCustomScrollBars.xaml
. You can override these in your application resources. - Popup Behavior:
The popup closes automatically when clicking outside, thanks toStaysOpen="False"
.
API
Property | Type | Description |
---|---|---|
PickerIcon | ImageSource | Set picker down icon as per choice. |
ItemsSource | IEnumerable | The collection of items to display. |
SelectedItem | object | The currently selected item. |
SelectedIndex | int | The index of the selected item. |
DisplayMemberPath | string | The property name to display for each item. |
FontFamily | FontFamily | The font family for text. |
FontSize | double | The font size for text. |
BackgroundColor | Brush | The background color of the header and popup. |
BorderBrushColor | Brush | The border color of the header and popup. |
SelectionChanged | event | Raised when the selection changes. |
ShowSearchBar | bool | Show textbox for search item from list. |
Requirements
- .NET 8
- WPF Application
License
This project is licensed under the MIT License.
Support
Contributions, issues, and feature requests are welcome! Please open an issue or submit a pull request.
Attribution
Flaticon
Combo box icons created by rcherem - Flaticon
ComboBox-Wpf � The easy way to add a modern combobox to your WPF apps.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows10.0.26100 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
-
net8.0-windows10.0.26100
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Buf fxies.