TextboxPlaceholder-Wpf 1.1.0

dotnet add package TextboxPlaceholder-Wpf --version 1.1.0
                    
NuGet\Install-Package TextboxPlaceholder-Wpf -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TextboxPlaceholder-Wpf" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TextboxPlaceholder-Wpf" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="TextboxPlaceholder-Wpf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TextboxPlaceholder-Wpf --version 1.1.0
                    
#r "nuget: TextboxPlaceholder-Wpf, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TextboxPlaceholder-Wpf@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TextboxPlaceholder-Wpf&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=TextboxPlaceholder-Wpf&version=1.1.0
                    
Install as a Cake Tool

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

  1. Add Namespace

In your XAML file:

xmlns:tp="clr-namespace:TextboxPlaceholder_Wpf;assembly=TextboxPlaceholder-Wpf"

  1. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.