Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
When I open a Xml file with VS2015,there are some menu items visible, but when I open a .cs file some other menu items are visible. How the vs complete it?
What is the mechanism?

What I have tried:

as if the vs used a thread to manage the menu items,but I am not sure.
Posted
Updated 30-Aug-16 7:19am
v2
Comments
Leo Chapiro 30-Aug-16 10:51am    
What shall be a problem to assemble the menu items dynamically dependent on context?
What have you not understood here?
Richard MacCutchan 30-Aug-16 11:59am    
This is fairly standard with most modern applications. When the user clicks on a menu, the application builds the menu dynamically depending on the current context.

1 solution

You didn't mention any specif UI tech to do that...
But you can do that easily in any C#-UI tech I know. You can create/add/delete/modify menu-items with code at runtime.
If you use e.g. WPF/XAML you will use bindings on the ui-side, but even if you use not UI-Tech specific MVVM-ViewModels you can change the model that represents your MenuItems dynamically.
So I can just guess you did only create menus with a designer (e.g. WinForms-Designer)and never looked at the code (Markup) that is produced? Hard to imagine what could be your problem - can you eleborate a little what you don't "understand" about a dynamic menu mechanism? (there are no dumb questions!)
You mentioned "threads" - I see no relation from the underlaying problem of a dynamic menu to multithreading...
 
Share this answer
 
Comments
codeprojectddx 30-Aug-16 20:35pm    
Yes,what I just want to know is the "dynamic menu mechanism".Thanks for your post.not long ago I did not know the phrase,now I know it is called "dynamic menu mechanism".

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900