contextmenu - Silverlight ContextMenuService sharing menus for several controls -


i building both silverlight , wpf clients our project.

when try assign context menus controls, seems me context menu can assigned 1 control @ time, true?

e.g. when drawing several lines

contextmenu contextmenu = createlinemenu();  (int = 0; < points.count - 1; i++)         {             line l = new line();             ...             canvas.children.add(l);             contextmenuservice.setcontextmenu(l, contextmenu);             }         } 

the menu works line added last.

a single context menu can assigned 1 parent object @ time added visual tree under child (and no visual element can have multiple parents in sl/wpf).

if @ how context menus defined in xaml become clearer.

to share 1 instance of context menu need dynamically assign (e.g. when mouse right button clicked, or other event).

this seem inefficient way define context menus, sure others have created generic ways share them... keep on searching (i will).


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -