My WPF libraries
dotnet add package KzWpfControl
dotnet add package KzWpfToolkit
dotnet add package EventHandlerHistory
See sandbox
WPF Controls. Set urn:kzrnm-wpf/controls
to xmlns
.
<Window xmlns:kz="urn:kzrnm-wpf/controls">
ComboBoxBehavior.IsFirstEmpty
: Insert empty item befor first item.
<ComboBox kz:ComboBoxBehavior.IsFirstEmpty="True">
<ComboBoxItem>1</ComboBoxItem>
<ComboBoxItem>2</ComboBoxItem>
<ComboBoxItem>3</ComboBoxItem>
</ComboBox>
Even if UpdateSourceTrigger=PropertyChanged
, text will follow input.
<kz:DoubleTextBox DoubleText="{Binding DoubleProperty, UpdateSourceTrigger=PropertyChanged}" />
<TextBox Text="{Binding DoubleProperty, UpdateSourceTrigger=PropertyChanged}" />
If your xaml is above, text may not follow input.
Input | Text |
---|---|
1 | 1 |
1. | 1 |
1.0 | 1 |
1.1 | 1.1 |
TextBoxBehavior.SelectAllOnFocus
: Select text on focus the TextBox.
<TextBox kz:TextBoxBehavior.SelectAllOnFocus="True" Text="foo" />
Library for .NET Community Toolkit/MVVM toolkit.
Set urn:kzrnm-wpf/toolkit
to xmlns
.
<Window xmlns:kz="urn:kzrnm-wpf/toolkit">
For Ioc
.
Ioc.AutoViewModel
: Auto set view model
<Window
x:Class="sandbox.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ktk="urn:kzrnm-wpf/toolkit"
xmlns:local="clr-namespace:sandbox"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
ktk:IocBehavior.AutoViewModel="{x:Type local:MainViewModel}" >
</Window>
For testing.