VariableBox.Avalonia
0.8.0
dotnet add package VariableBox.Avalonia --version 0.8.0
NuGet\Install-Package VariableBox.Avalonia -Version 0.8.0
<PackageReference Include="VariableBox.Avalonia" Version="0.8.0" />
paket add VariableBox.Avalonia --version 0.8.0
#r "nuget: VariableBox.Avalonia, 0.8.0"
// Install VariableBox.Avalonia as a Cake Addin #addin nuget:?package=VariableBox.Avalonia&version=0.8.0 // Install VariableBox.Avalonia as a Cake Tool #tool nuget:?package=VariableBox.Avalonia&version=0.8.0
VariableBox
<p align="center">
Want to help
欢迎任何人士帮忙支持并让这个简单控件变得更好,我们需要你们。
welcome any one to help and make this simple control better, we need you.
</p>
<p align="center"> <img src="Logo.svg" alt="drawing" width="150" /> </p>
<p align="center">
</p>
VariableBox is an Avalonia Control for building cross-platform UIs with Avalonia UI.
Theme | Fluent | Semi |
---|---|---|
Dark | ||
Light |
ChangeLog
2025/03/10(0.8.0)
- unify the semi NumericalBox and VariableBox
- Use MonoSpace etc. font by default
- Update readme for event and command
- Update demo for event and command
2025/02/25(0.7.0)
- Mass UI Polish
- Uniform the UI for each App Theme
- An new Spinner Theme for FluentTheme
- you can change the
NumericUpDown
Theme just likeVariableBox
- you can change the
2025/02/21(v0.6.0)
- unify the
tab
key focus behavior, only the text box and read write button can be focused - fix the enter key trigger behavior bug
- style polish, uniform the style of the button spinner and the disabled style
- demo update
- unify the
2025/02/20(v0.5.0)
- remote property
IsEnableEditingIndicator
indicator - please use the
PseudoClasses
:editing
for editing:invalid
for invalid input
- remote property
2025/02/19(v0.4.0)
- fix the style of buttonspinner and the disabled style
- fluent,semi and simple is all supported
- fix the style of buttonspinner and the disabled style
2025/1/21(v0.3.0)
- Add an overall border to create a more unified visual effect.
- other polish
2025/1/9 (v0.2.1)
- Using a theme pack that is compatible with
Simple
,Fluent
, andSemiThemes
. - Package Theme To the Control Package, You do not need another package anymore
- Using a theme pack that is compatible with
Feature
NumericalUpDown
- all numerical type support
- spinning updown support
- get (read) /set (write) support
- rich formatting support like
hex
,dec
andbin
- drag support, you can use mouse to drag
- mouse scroll support
- shortcut and arrow key support
- <kbd>Esc</kbd> for cancel editing
- <kbd>Enter</kbd> for trigger
- <kbd>up</kbd> for increase
- <kbd>down</kbd> for decrease
- <kbd>alt+left</kbd> for read
- <kbd>alt+right</kbd>/<kbd>alt+enter</kbd>for trigger (force) write
- identify support
*
for editing- red <font color=red>*</font> for error input
- green <font color=green>*</font> for right input
EnumerationUpDown
- compact mode
- boarder
How to use
VariableBox
Add nuget package:
dotnet add package VariableBox.Avalonia
You can now use VariableBox controls in your Avalonia Application.
<Window
...
xmlns:vbox="VariableBox"
...>
<StackPanel Margin="20">
<vbox:VariableBoxUInt Value="{Binding Value}"
FormatString="X8"
HeaderContent="0x"
ParsingNumberStyle="AllowHexSpecifier"
Step="2"
IsEnableEditingIndicator="True"
/>
</StackPanel>
</Window>
CommandS and Events
FYI, you can see demo.
Event
we have Read and Write(ValueChenged)Event.
ValueChanged or you click write, you can get the old and new value
public event EventHandler<ValueChangedEventArgs<T>>? ValueChanged
ReadRequestedEvent When you Click Read,
you can update your value while reading and there is not valueChangeEvent
public event RoutedEvent<RoutedEventArgs> ReadRequestedEvent
HeaderDoubleTapedEvent When you Double the header
public static readonly RoutedEvent<TappedEventArgs> HeaderDoubleTapedEvent
Command for MVVM
Commnad
Value changed or click the writePlease don't set the CommandParater to Current Value, Like
CommandParameter="{Binding Value}"
will get you the old value- you can just binding with a command like
WriteCommnad(uint v)
, you don't need to set the Command parater by default - we will send the updated-value for you
- you can just binding with a command like
ReadCommand
When you click Readsame as
Commnad
, The default parameter will be the current valueHeaderDoubleTapedCommand
when you double click the Header
Demo
//view
Command="{Binding TrythisCommand}"
ReadCommand="{Binding ReadDemoCommand}"
// viewmodel
[RelayCommand]
void Trythis(uint v)
{
CommandUpdateText =
$"Binding without CommandParater, and the default parameter will be the new value={v}";
}
// viewmodel
[RelayCommand]
void Trythis()
{
// also work too
}
// viewmodel
[RelayCommand]
void ReadDemo(uint v)
{
CommandUpdateText =
$"Binding without CommandParater,
and the default parameter will be the current value={v}";
}
// viewmodel
[RelayCommand]
void ReadDemo()
{
// also work too
}
Note for command
CommandParameter="{Binding Value}"
will get you the old value
PseudoClasses
VariableBox is based vbox:NumericUpDown
:editing
for editing:invalid
for invalid input
e.g.:
<div style="display: flex;"> <div style="flex: 50%; padding: 2px;">
<Style Selector="vbox|NumericUpDown:editing">
<Style Selector="^ /template/ TextBox#PART_TextBox">
<Setter Property="Foreground" Value="Green" />
</Style>
<Style Selector="^:invalid /template/ TextBox#PART_TextBox">
<Setter Property="Foreground" Value="Red" />
</Style>
</Style>
</div>
<div style="flex: 20%; padding: 2px;">
</div> </div>
VariableBox.Themes
To make VariableBox controls show up in your application, you need to reference to a theme package designed for VariableBox.
YOU do not need any other VariableBox package now
vbox:FluentTheme
is compatible with<FluentTheme/>
vbox:SemiTheme
is a theme package for VariableBox inspired by Semi Design.you need to
add package Semi.Avalonia
firstvbox:SimpleTheme
is compatible with<SimpleTheme/>
You can add it to your project by following steps.
- Add nuget package:
dotnet add package VariableBox.Avalonia
- Include Styles in application:
- FluentTheme
<Application...
xmlns:vbox="VariableBox"
....>
<Application.Styles>
<vbox:FluentTheme Locale="zh-CN"/>
</Application.Styles>
- SimpleTheme
<Application...
xmlns:vbox="VariableBox"
....>
<Application.Styles>
<SimpleTheme/>
<vbox:SimpleTheme Locale="zh-CN"/>
</Application.Styles>
- SemiTheme
dotnet add package Semi.Avalonia
<Application...
xmlns:vbox="VariableBox"
....>
<Application.Styles>
<semi:SemiTheme Locale="zh-CN"/>
<vbox:SemiTheme Locale="zh-CN"/>
</Application.Styles>
Additional Theme for Fluent ButtonSpinner
for FluentTheme
user, you can changed the ButtonSpinner
just like VariableBox
for example:
ButtonSpinner
<ButtonSpinner Content="10" Theme="{DynamicResource FluentButtonSpinner}" />
- Sys
NumericUpDown
<NumericUpDown InnerLeftContent="Theme" Value="2">
<NumericUpDown.Styles>
<Style Selector=":is(ButtonSpinner)">
<Setter Property="Theme" Value="{DynamicResource FluentButtonSpinner}" />
</Style>
</NumericUpDown.Styles>
</NumericUpDown>
<Style Selector="NumericUpDown /template/ :is(ButtonSpinner)">
<Setter Property="Theme" Value="{DynamicResource FluentButtonSpinner}" />
</Style>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
NuGet packages (1)
Showing the top 1 NuGet packages that depend on VariableBox.Avalonia:
Package | Downloads |
---|---|
VariableBox.Avalonia.Themes.Semi
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
0.8.0 | 176 | 10 days ago | |
0.7.0 | 118 | 23 days ago | |
0.6.0 | 109 | a month ago | |
0.5.0 | 106 | a month ago | |
0.4.1 | 103 | a month ago | |
0.4.0 | 116 | a month ago | |
0.3.0 | 184 | 2 months ago | |
0.2.1 | 117 | 2 months ago | |
0.2.0 | 99 | 2 months ago | |
0.1.2-beta20250109 | 66 | 2 months ago | |
0.1.1-beta20250106 | 98 | 2 months ago | |
0.1.0-beta20250103 | 124 | 3 months ago | |
0.0.5-beta20240803 | 319 | 8 months ago | |
0.0.4-beta20240604 | 172 | 10 months ago | |
0.0.3-beta202404081 | 198 | 4/8/2024 | |
0.0.3-beta20240408 | 108 | 4/7/2024 | |
0.0.3-beta20240407 | 104 | 4/7/2024 | |
0.0.2-beta20240407 | 103 | 4/7/2024 | |
0.0.1-beta20240406 | 105 | 4/6/2024 | |
0.0.1-beta20240404 | 102 | 4/3/2024 |