Search code examples
avaloniaui

TabControl without header in Avalonia UI


I would like to create a simple wizard based on a TabControl in Avalonia UI with four pages. Each page with a few controls. Instead of the TabItem headers I would like to create my own buttons and hide the default TabItem headers.

There are plenty of solutions for WPF, mostly involving ItemsContainerStyle and the Visibility property, both of which don't seem to be accessible in the Avalonia TabControle.

Is there any way to hide the headers? Or is there a better way to implement a wizard?


Solution

  • You probably need to use the Carousel class directly. It's used by the TabControl internally for presenting the current item.

    See example usage here:

    https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml - markup

    https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml.cs - codebehind