Marty
Marty

Reputation: 3555

XAF: How to minimize ribbon from code in XAF Windows App

I want to minimize the ribbon when user click on particular navigation Item. For example - when User clicks on Dashboard nav item, I want the ribbon minimized, and automatically "maximized" on others.

How can I do that ?

Upvotes: 1

Views: 991

Answers (2)

Serdin Çelik
Serdin Çelik

Reputation: 203

They released a hotfix for this bug in Devexpress's version 22.1.4. Today I updated to 22.1.4 while getting this error when there was version 22.1.3 and the error was completely resolved.

NullReferenceException is thrown in the MinimizedRibbonPopupForm.GetSizeWithIndents method when the Classic panel style is used

Upvotes: 0

Marty
Marty

Reputation: 3555

I've found that I can simple access the ribbon in the ViewController. So like usual in XAF, override "OnActivated" and do the magic there

    protected override void OnActivated()
    {
        if (Frame.Template != null)
        {
            ((XtraFormTemplateBase)Frame.Template)).RibbonTransformer.Ribbon
                                           .Minimized = View.Id == "TestView;
        }
        base.OnActivated();
    }

I got a couple of errors while accessing Frame.Template being NULL when I'd hit a dashboardview, with many nested ListView in it. Make sure You don't forget to check it :)

Upvotes: 2

Related Questions