Another attempt to recreate the GroupBox control for AvaloniaUI.
Based on @derekantrican's Classic and Modern GroupBox examples at [GroupBox] Missing · Issue #823 · AvaloniaUI/Avalonia.
When this library is production-ready, its themes/styles may be pull-requested to teast/Avalonia.GroupBox. Otherwise, someone else will need to maintain this project.
- Sample app re-distributes the checkbox labels...weirdly.
- Add the package: https://www.nuget.org/packages/BinToss.GroupBox.Avalonia/
dotnet add package BinToss.GroupBox.Avalonia
-
In an AXAML/XAML file, add the following xmlns statement:
xmlns:gb="using:GroupBox.Avalonia.Controls"
. I usedctrl
in the sample project, but other projects should usegb
. -
Add a basic GroupBox via
<gb:GroupBox/>
GroupBox.Avalonia/GroupBox.Avalonia.Sample/Views/MainView.axaml
Lines 25 to 31 in 5515704
For its contents, you should use a
Panel
-basedControl
such asGrid
orStackPanel
. It's a GroupBox, after all. -
(Optional) To use the "classic" theme replicating Windows' classic GroupBox, use
Theme="{StaticResource GroupBoxClassic}"
GroupBox.Avalonia/GroupBox.Avalonia.Sample/Views/MainView.axaml
Lines 16 to 18 in 5515704
For more info, see GroupBox.Avalonia.Sample.