Is there a standard way to delay all the initialization of the stuff hidden in the XamRibbon.ApplicationMenu2010?
I like being able to set everything up in the xaml ribbon but it becomes a huge extra overhead when the xamRibbon is loaded. Why do all the nested ApplicationMenu2010Item and child controls all get created and loaded right away? In many cases these things are never even seen.
I'm experimenting with using ApplicationMenu2010.SelectedTabItemProperty to detect when users move around from one application tab item to another. Is this where I'm supposed to dynamically create xaml-based controls (eg from a resource dictionary)? I wish there was just a simple property to delay all the initialization of stuff that may never even be seen.
Hi dbeavon,
I think it's mainly for giving the user a responsive experience when they are clicking through the menu items and they immediately see the child controls come up rather than waiting for them to be loaded after they clicked on the item.
Rather than using a ResourceDictionary I would create a set of UserControls for your tabs that contain the controls you want, that way when the user clicks on a tab, depending on which tab they clicked on you can instantiate the proper UserControl and assign it to the tab's content. You should first check to see if the tab has content to begin with to avoid creating more UserControl instances than necessary. When the UserControl is instantiate and is set as the tab content, this will trigger the controls inside the UserControl to start loading as they are about to be rendered. This would give you the lazy loading that you are looking for.
Having a built in property that delays initialization could be useful though, especially for the scenario you mentioned. I recommend that you submit this as a new product idea here: http://ideas.infragistics.com.
Thanks for the pointers. I will try your suggestions.
Hello,
Were you able to resolve your issue?
Sincerely,Valerie Developer Support Supervisor - XAMLInfragisticswww.infragistics.com/support
I'm using the dependency called "SelectedApplicationTabItem". I use data binding and, in the setter property that is bound, I initiate the creation of the controls for the particular tab that is selected.
I was surprised to not find a simple event that is called when the Application Tab Item changes. Did I miss something?
So yes, I think I have an approach that works for me.