Current filter:
                                You should refresh the page.
                                  • [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); } } }



                                • Vera (DevExpress) 11.14.2018
                                  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?
                                • Marco Kummer 11.14.2018
                                  Sure, please find the sample attached, generated with V 18.2.3.0

                                  Reproduction steps:
                                  1. Create new XAF solution
                                  2. Add business class
                                  3. Change class image to real image (I picked from SVG lib)
                                  4. Set Navigation style to Accordion in App model
                                  5. Run. Accordion has no images.
                                • Marco Kummer 11.14.2018
                                  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.
                                • Marco Kummer 11.14.2018
                                  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. 

                                1 Solution

                                Creation Date Importance Sort by

                                Marco,

                                Thank you for the detailed information. It looks like you have two different scenarios here.

                                1. In the first case, you have a new project generated with XAF 18.2.3.0. While the ShowImages value is true in the AccordionImages.Module and AccordionImages.Module.Win projects, it is false in the AccordionImages.Win project. All new applications created in XAF 18.2.3.0 have the ShowImages property set to false in the YourSolutionName.Win project. To display images, do the following:
                                - Invoke the Model Editor from the AccordionImages.Win project.
                                - Click the NavigationItems node.
                                - Set the ShowImages value to true.
                                - Save.

                                Note that if end users accessed the end-user Application Model's layer, they may need to manually set ShowImages to true in their application.

                                You can learn more about the Application Model's layered structure in the following article: Application Model's Layered Structure.
                                 

                                2. In the second scenario, you have an older project upgraded to v18.2. All projects created in older XAF versions have ShowImages set to true on all Application Model layers. The ShowImages values did not change when you upgraded the project. That is why in the second case, you can see the images. 

                                Images in tabs work in a similar fashion and are controlled by the ShowTabImage property.

                                Please let me know if my further assistance is required.

                                Show all comments
                                • Marco Kummer 11.15.2018
                                  thanks for your excellent support. BTW, I'm an XAF developer of the first hour (since 2008), so I'm very aware of the layered structure. However, up until now it was not common practice to override regular properties in the Project.Win exection layer. This seems a bit odd to me, and very unintuitive. If at all, you guys should override it on the Module.Win level. Thanks!
                                • Dennis (DevExpress Support) 11.15.2018

                                  Hello Marco,

                                  Thank you for your feedback. It's nice to see you again!

                                  In fact, both approaches are fine. In the future, it is possible that we will set ShowImages = False at the YourSolutionName.Module project level for new projects and demos, especially since SPA UI is fast approaching. BTW, I hope to see you in the SPA UI forums as in the old days!

                                • Dom Sinclair 11.30.2018
                                  Hi

                                  New project created with 18.2.3.

                                  Navigations items style set to Accordion, ShowImages set to true.  However when the solution is built and run the images do not appear on the accordion.

                                  Attached images show my settings in the application model designer and the application when running.  FYI I configured the specific windows module settings to exactly mirror those I set in the application model.


                                  Dom
                                • Vera (DevExpress) 12.02.2018

                                  Hello Dom,

                                  Thank you for your question. If you are using the Solution Wizard to create a new WinFroms application, the Solution Wizard sets the ShowImages property to false in the YourApplication.Win project. This means, the Accordion images are turned off in the Application Model's application layer and can be turned on at only that level. I suspect you may have changed model options either in the YourApplication.Module.Win or YourApplication.Module project, and that is why the images are invisible. Please invoke the Model Editor from your WinForms application project and check that ShowImages is set to true there.

                                  Please let me know if this helps.

                                • Dom Sinclair 12.02.2018
                                  Hi Vera

                                  Thank you, your diagnosis of my error was spot on, images are now appearing on the accordion.

                                  Is there an article anywhere that lists all of the defaults set by the solution wizard, and where they have been set?

                                  Dom
                                • Vera (DevExpress) 12.03.2018

                                  Excellent - I am happy to hear you were able to make this work. You can find a complete list of default settings in the following KB article: Default XAF configuration options and feature toggles.