Skip to content

A casual attempt at a "classic" styled GroupBox for Avalonia. This repository primarily serves as a minor improvement over @derekantrican's Classic and Modern GroupBox examples at https://github.com/AvaloniaUI/Avalonia/issues/823#issuecomment-692270581

License

Notifications You must be signed in to change notification settings

BinToss/GroupBox.Avalonia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

semantic-release: conventionalcommits avalonia

CI Release latest

GroupBox.Avalonia

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.

GroupBox.Avalonia.Sample.png GroupBox.Avalonia.Sample.png

Known Issues

  • Sample app re-distributes the checkbox labels...weirdly.

Usage

  1. Add the package: https://www.nuget.org/packages/BinToss.GroupBox.Avalonia/
dotnet add package BinToss.GroupBox.Avalonia
  1. In an AXAML/XAML file, add the following xmlns statement: xmlns:gb="using:GroupBox.Avalonia.Controls". I used ctrl in the sample project, but other projects should use gb.

    <UserControl x:Class="GroupBox.Avalonia.Sample.Views.MainView"
    xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ctrl="using:GroupBox.Avalonia.Controls"
    xmlns:themes="using:GroupBox.Avalonia.Themes">

  2. Add a basic GroupBox via <gb:GroupBox/>

    <ctrl:GroupBox Header="Basic (default)"
    Grid.Row="0" Grid.Column="1">
    <StackPanel>
    <CheckBox>CheckBox0</CheckBox>
    <CheckBox>CheckBox1</CheckBox>
    </StackPanel>
    </ctrl:GroupBox>

    For its contents, you should use a Panel-based Control such as Grid or StackPanel. It's a GroupBox, after all.

  3. (Optional) To use the "classic" theme replicating Windows' classic GroupBox, use Theme="{StaticResource GroupBoxClassic}"

    <ctrl:GroupBox Header="Classic"
    Theme="{StaticResource GroupBoxClassic}"
    Grid.Row="0" Grid.Column="0">


For more info, see GroupBox.Avalonia.Sample.

About

A casual attempt at a "classic" styled GroupBox for Avalonia. This repository primarily serves as a minor improvement over @derekantrican's Classic and Modern GroupBox examples at https://github.com/AvaloniaUI/Avalonia/issues/823#issuecomment-692270581

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages