In my XAF application Breadcrumbs display the navigation history of the user. I want to customize it according to my requirements. Like the Breadcrumb should display history. Instead It should display the links Like Home>User> UserName > (Home and User Will be links ) Or Home>SalesDashBoard>Lead>LeadDetails> (Home, SalesDashboar and Lead are Links in this case) etc**.** How to write a WindowContoller to accomplish this task. thanks in advance
Customize Breadcrumbs in XAF
Answers approved by DevExpress Support
Hello Zac,
Currently, it is possible to customize the default behavior by overriding the CreateNavigationHistory method of the standard WebViewNavigationController class.
By default, it uses the BreadCrumbsNavigationHistorySequenceStrategy<ViewShortcut> class to define how bread crumbs are generated:
C#protected override NavigationHistory<ViewShortcut> CreateNavigationHistory() {
return new NavigationHistory<ViewShortcut>(new BreadCrumbsNavigationHistorySequenceStrategy<ViewShortcut>(HistoryDepth));
}
I am afraid we do not have any documentation on this class, so I can only advise you by referring to the source code to see how it is implemented:
…\DevExpress.ExpressApp\Utils\NavigationHistory.cs
In the UI, history links are shown using the NavigationHistoryActionContainer control (…\DevExpress.ExpressApp.Web\Templates\ActionContainers\NavigationHistoryActionContainer.cs) placed to the page template (Default.aspx) below the view caption. This is an action container, and it shows actions with the ViewsHistoryNavigation category, in particular, the WebViewNavigationController.NavigateToAction. Items of this SingleChoiceAction are shown as links by the NavigationHistoryActionContainer.
It is possible to customize this control (e.g., set its Delimiter property) as required.
Take special note that it is possible to build your own Action Container and place it on the page instead of the default NavigationHistoryActionContainer.
While I do not have a complete and ready example that shows how to accomplish your precise task, I hope you find this information helpful in performing the necessary customizations. Let me know if you have any questions.
Hello Zak,
We are working on your issue and will get back to you as soon as we can. In the meantime, please review the how to change history links ticket.