[DevExpress Support Team: CLONED FROM T689702: Images in navigation pane]
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 question. We need additional information to research why the new Accordion Navigation does not show images in your application.
Could you please send us a screenshot and a sample project to illustrate the issue?
Sure, please find the sample attached, generated with V 18.2.3.0
Reproduction steps:
Plase also note: The ShowImages property on the Navigation node is already set to true by default. I tried setting it to true explicitely, but that didn't help.
Sorry, one more note: I just upgraded another (existing) 18.1 project to 18.2, and there the accordion shows images! So I'm beginning to suspect that the problem could lie within your VS templates of 18.2.
By the way, the tab images expose the same problem: A newly created 18.2 solution shows no tab images, while the upgraded solution displays them perfectly.