ComboBox-Wpf
1.1.0
See the version list below for details.
dotnet add package ComboBox-Wpf --version 1.1.0
NuGet\Install-Package ComboBox-Wpf -Version 1.1.0
<PackageReference Include="ComboBox-Wpf" Version="1.1.0" />
<PackageVersion Include="ComboBox-Wpf" Version="1.1.0" />
<PackageReference Include="ComboBox-Wpf" />
paket add ComboBox-Wpf --version 1.1.0
#r "nuget: ComboBox-Wpf, 1.1.0"
#:package ComboBox-Wpf@1.1.0
#addin nuget:?package=ComboBox-Wpf&version=1.1.0
#tool nuget:?package=ComboBox-Wpf&version=1.1.0
ComboBox-Wpf
A reusable, customizable ComboBox control for WPF applications targeting .NET 8. This control provides a modern UI, supports data binding, and allows for easy integration and styling.
Features
- Customizable UI: Modern look with custom scrollbars and popup animation.
- Data Binding: Supports
ItemSource
,SelectedItem
,SelectedIndex
, andDisplayMemberPath
for flexible data binding. - Events: Exposes a
SelectionChanged
event for item selection handling. - MVVM Friendly: Designed for use in MVVM scenarios with dependency properties.
- Easy Styling: Includes a customizable arrow icon and supports custom scrollbars via XAML resources.
Getting Started
1. Add Reference
Add the ComboBox-Wpf
project to your solution or reference its compiled DLL in your WPF project.
2. Import Namespace
In your XAML file:
3. Use the Control
<local:ComboBoxView MinWidth="200" ItemSource="{Binding MyItems}" SelectedItem="{Binding MySelectedItem, Mode=TwoWay}" DisplayMemberPath="Name" />
API Overview
- ItemSource (IEnumerable): Items to display.
- SelectedItem (object): The currently selected item.
- SelectedIndex (object): The index of the selected item.
- DisplayMemberPath (string): Property name to display from each item.
- SelectionChanged (event): Raised when the selection changes.
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.
Requirements
- .NET 8
- WPF Application
Attribution
<a href="https://www.flaticon.com/free-icons/combo-box" title="combo box icons">Combo box icons created by rcherem - Flaticon</a>
<a href="https://www.flaticon.com">Flaticon</a>
License
MIT License. See LICENSE for details.
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.