none
Good place to define ContextMenu RRS feed

  • Question

  • Probably this is a stupid question, but I am very confused on which is a good place to define a ContextMenu.

    My application has Docking panel and the context menu needs to be shown on the panes. I wish to handle the Click event of the menuitem.

    Is app..xaml a good place. Is it advisable to add code in the app.xaml.cs?

    Monday, September 13, 2010 3:49 AM

Answers

  • Hi Xaria,

    Any component should be as less visible as possible. If you wouldn't be needing it outside the window, then you should be defining in the Window. If you think you would be needing it throughout the application then app.xaml is definitely a better choice. If you think you would be needing it across different applications then Resource Dictionary would be a great choice. 

    Muhammad
    shujaatsiddiqi.blogspot.com

    Monday, September 13, 2010 5:16 AM

All replies

  • Hi Xaria,

    Any component should be as less visible as possible. If you wouldn't be needing it outside the window, then you should be defining in the Window. If you think you would be needing it throughout the application then app.xaml is definitely a better choice. If you think you would be needing it across different applications then Resource Dictionary would be a great choice. 

    Muhammad
    shujaatsiddiqi.blogspot.com

    Monday, September 13, 2010 5:16 AM
  • Hi Xaria,

    I am marking this issue as "Answered". If you have any new findings or concerns about this issue, please feel free to let me know.

    Thank you and have a nice day!

    Best regards,

    Min


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, September 20, 2010 1:35 AM
    Moderator