Вопрос

I have a eXpressApp Framework (XAF) desktop application. The main window contains Navigation pane with tree of items. Is there any way to obtain the list of navigation items in code?

Это было полезно?

Решение

a XAF application model can be extended using interfaces. It is really easy to extend it and intentify it. For example in your situation I would open the model using ModelEditor and navigate to the NavigationItems node. When there you can look at the yellow info panel at the bottom of your form it says *Member of interface:*DevExpress.ExpressApp.SystemModule.IModelApplicationNavigationItems

This means that that XAF extended the model using the IModelApplicationNavigationItems, so we all need to do is to cast it to that interface and use its properties.

((IModelApplicationNavigationItems) Application.Model).NavigationItems.AllItems

This approach has the same result as yours, however is strongly bound!

Другие советы

It was not easy to find, but here is the solution:

var navigationItems = Application.Model.GetNode<IModelRootNavigationItems>("NavigationItems").AllItems;

Your code is suitable to get the list of navigation elements from the application model (a meta data tier). Alternatively, you can access the same information from the ShowNavigationItemController.ShowNavigationItem.Items property.

P.S. In the future, I suggest you use Support Center to get official and guaranteed assistance on the use of DevExpress products. Note that FULL SUPPORT IS FREE during the evaluation period (30 days).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top