Backstage tab icons ignore BarImageSize and show always small size

Bars for Avalonia Forum

Posted 3 days ago by kucint.bp
Version: 25.2.1
Platform: .NET 9
Environment: Windows 11 (64-bit)
Avatar


I create RibbonBackstageViewModel that contains couple of pages with appropriate icons:

    private RibbonBackstageViewModel CreateBackstage(BackstageCommands commands) => new()
    {
        Items =
        {
            new BackstageHomeTabViewModel()
            {
                SmallIcon = _imageProvider.GetImage(BackstageControlKeys.BackstageHome, BarImageSize.Small)
            },
            new BackstageNewTabViewModel()
            {
                SmallIcon = _imageProvider.GetImage(BackstageControlKeys.BackstageNew, BarImageSize.Small)
            },
            new RibbonBackstageHeaderButtonViewModel(BackstageControlKeys.BackstageOpen, "Open", commands.OpenCommand)
            {
                SmallIcon = _imageProvider.GetImage(BackstageControlKeys.BackstageOpen, BarImageSize.Small)
            },
    }

No matter which icon size I request: BarImageSize.Small, BarImageSize.Medium or BarImageSize.Large, the backstage shows always small icon.
I checked that _imageProvider delivers bitamps of appropriate size.

I tried as well to initialize RibbonBackstageTabViewModel.LargeIcon and RibbonBackstageHeaderButtonViewModel.LargeIcon rather than SmallIcon but it does not work either.



Comments (1)

Posted 3 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

The backstage tabs will use a 16x16 (small) size icon in the UI by default unless the tab has a Large VariantSize set.  In that case the template will switch to using a 32x32 (large) size icon in the UI. 

In the MVVM API, the RibbonBackstageTabViewModel.VariantSize property is what determines if the SmallIcon or LargeIcon are used.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.