Good morning,
I’m doing my first application with the new version of XAF 18.2.3, all options are by default. Why the navigation pane not shows any image? I attached an image to show this behaviour.
Kind regards,
Good morning,
I’m doing my first application with the new version of XAF 18.2.3, all options are by default. Why the navigation pane not shows any image? I attached an image to show this behaviour.
Kind regards,
Hello Francisco,
Thank you for your question. All new XAF applications created in v18.2.3 use the Accordion Navigation style to match the latest Microsoft Office apps. The Accordion-style Navigation displays nodes in accordion groups and with no icons (IModelRootNavigationItems.ShowImages = false). We have added BC4527 associated with the change.
To display icons in the Navigation System, set the ShowImages property to true.
I hope this helps.
Hi Vera, hi Francisco
Strangely the new accordion navbar does not show images, even when you set ShowImages=true in the application model (which is its default value, by the way).
I have written a quick-fix using a WindowController that I'd like to share with you below. But I suppose the missing images can be considered a bug.
C#public class AccordionImagesWindowController : WindowController
{
public AccordionImagesWindowController()
{
InitializeComponent();
TargetWindowType = WindowType.Main;
}
protected override void OnActivated()
{
base.OnActivated();
ShowNavigationItemController navigationController = Frame.GetController<ShowNavigationItemController>();
if (navigationController != null)
{
Frame.GetController<ShowNavigationItemController>().ShowNavigationItemAction.CustomizeControl +=
ShowNavigationItemAction_CustomizeControl;
}
}
protected override void OnDeactivated()
{
ShowNavigationItemController navigationController = Frame.GetController<ShowNavigationItemController>();
if (navigationController != null)
{
Frame.GetController<ShowNavigationItemController>().ShowNavigationItemAction.CustomizeControl -=
ShowNavigationItemAction_CustomizeControl;
}
base.OnDeactivated();
}
private void ShowNavigationItemAction_CustomizeControl(object sender, CustomizeControlEventArgs e)
{
AccordionControl accordion = e.Control as AccordionControl;
if (accordion == null)
return;
AddImages(accordion.Elements);
}
private void AddImages(AccordionControlElementCollection elements)
{
foreach (var element in elements)
{
element.ImageOptions.ImageLayoutMode = ImageLayoutMode.Stretch;
var cai = (element.Tag as ChoiceActionItem);
if (cai != null && cai.ImageName != "BO_Folder")
{
element.Image = ImageLoader.Instance.GetImageInfo(cai.ImageName).Image;
}
AddImages(element.Elements);
}
}
}
Hello Marco,
Thank you for your solution. I've created a separate ticket on your behalf (T690584: The new Accordion NavBar does not show images) to address the missing images issue. The ticket has been placed in our processing queue and will be answered shortly.
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.