TextboxPlaceholder-Wpf
1.1.0
dotnet add package TextboxPlaceholder-Wpf --version 1.1.0
NuGet\Install-Package TextboxPlaceholder-Wpf -Version 1.1.0
<PackageReference Include="TextboxPlaceholder-Wpf" Version="1.1.0" />
<PackageVersion Include="TextboxPlaceholder-Wpf" Version="1.1.0" />
<PackageReference Include="TextboxPlaceholder-Wpf" />
paket add TextboxPlaceholder-Wpf --version 1.1.0
#r "nuget: TextboxPlaceholder-Wpf, 1.1.0"
#:package TextboxPlaceholder-Wpf@1.1.0
#addin nuget:?package=TextboxPlaceholder-Wpf&version=1.1.0
#tool nuget:?package=TextboxPlaceholder-Wpf&version=1.1.0
TextboxPlaceholder-Wpf
A customizable WPF TextboxView control for .NET 8+ that provides modern placeholder functionality, extended styling, and enhanced event support for text input scenarios.
Features
- Placeholder Text: Displays a placeholder when the textbox is empty.
- Bindable Properties: Easily bind text, placeholder, max length, caret index, read-only state, and more.
- Styling: Customize font, color, alignment, and textbox style.
- Events: Exposes extended events for key, focus, and text changes.
- MVVM Friendly: All main properties are dependency properties for easy data binding.
Installation
Install via NuGet Package Manager:
Or via .NET CLI:
dotnet add package TextboxPlaceholder-Wpf
Usage
- Add Namespace
In your XAML file:
xmlns:tp="clr-namespace:TextboxPlaceholder_Wpf;assembly=TextboxPlaceholder-Wpf"
- Add the TextboxView Control
<tp:TextboxView
Placeholder="Enter your name"
Text="{Binding UserName, Mode=TwoWay}"
MaxLength="50"
FontFamily="Segoe UI"
FontSize="14"
ForegroundColor="DarkSlateGray"
PlaceHolderTextAlignment="Left"
PlaceholderColor="LightGray"
ForegroundColor="DarkSlateGray"
HorizontalContentAlignment="Center"
IsReadOnly="False"/>
API Overview
Property | Type | Description |
---|---|---|
Padding | Thickness | Padding of the textbox. |
Text | string | The text content of the textbox. |
Placeholder | string | The placeholder text to display. |
MaxLength | int | Maximum allowed length of input. |
CaretIndex | int | Current caret position. |
IsReadOnly | bool | Sets the textbox as read-only. |
FontFamily | FontFamily | Font family for the textbox. |
FontSize | double | Font size for the textbox. |
ForegroundColor | Brush | Foreground color of the text. |
PlaceholderColor | Brush | Color of the placeholder text. |
HorizontalContentAlignment | HorizontalAlignment | Text alignment inside the textbox. |
VerticalContentAlignment | VerticalAlignment | Text alignment inside the textbox. |
PlaceHolderTextAlignment | TextAlignment | Alignment of the placeholder text. |
StyleTextBox | Style | Custom style for the inner textbox. |
MarginTextBox | Thickness | Margin for the inner textbox. |
BorderBrush | Brush | Border color of the textbox. |
BorderThickness | Thickness | Border thickness for the textbox. |
TextWrapping | TextWrapping | Wrapping of the textbox. |
FontWeight | FontWeight | Font Weight for the textbox. |
Events
- ExtKeyUp
- ExtKeyDown
- ExtGotFocus
- ExtTextChanged
- ExtPreviewTextInput
Subscribe to above events in code-behind for advanced scenarios.
Requirements
- .NET 8 or later
- Windows Presentation Foundation (WPF)
Attribution
Flaticon
Text icons created by Freepik - Flaticon
License
This project is licensed under the MIT License.
Contributing
Contributions, issues, and feature requests are welcome! Please open an issue or submit a pull request.
TextboxPlaceholder-Wpf � The easy way to add a modern textbox 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.
Version | Downloads | Last Updated |
---|---|---|
1.1.0 | 71 | 8/1/2025 |
New textbox control for wpf with placeholder.