Gu.Wpf.Validation
Attached properties for WPF TextBox
Install / Use
/learn @GuOrg/Gu.Wpf.ValidationREADME
Gu.Wpf.Validation
A set of attached properties for TextBox.
Sample:
<TextBox validation:Input.Value="{Binding DoubleValue}"
validation:Input.NumberStyles="AllowDecimalPoint,AllowLeadingSign,AllowLeadingWhite"
validation:Input.Min="-10"
validation:Input.Max="10"
validation:Input.DecimalDigits="2"
validation:Input.ValidationTrigger="PropertyChanged" />
<TextBox validation:Input.Value="{Binding StringValue}"
validation:Input.Pattern="a\d+"
validation:Input.IsRequired="True"
validation:Input.ValidationTrigger="PropertyChanged" />
For more samples see demo project.
- Creates a binding Text > validation:Input.Value internally. The binding has validationrules so it uses standard WPF validation. It picks up the type from the binding and selects default parsing/validation/formatting based on that.
- No custom controls.
- Higly configurable.
- IValidator, plug in a validator of your own.
- ITypeNumberStyles, plug in default numberstyles of choice.
- ITypeRules, plug in default validationrules of choice.
- ITypeStringConverters, plug in custom handling of to/from string.
- All ^ can of course be bound per instance.
- Validates as you type or on lost focus.
Related Skills
node-connect
349.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
