XAF: How to minimize ribbon from code in XAF Windows App
-
01-07-2021 - |
Frage
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 ?
Lösung
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 :)
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow