-3

I want to open a POP up on a context menu button click in C#.Please help.

And thanks in advance

  • 5
    Welcome! put your code example that what you try for. and visit link **[How to Ask](http://stackoverflow.com/help/mcve)** . – Zaheer Ul Hassan Apr 17 '17 at 05:52
  • Take a look to this one http://stackoverflow.com/questions/25845689/opening-new-window-in-mvvm-wpf – Rekshino Apr 17 '17 at 05:59
  • 2
    Welcome to StackOverflow. To get better answers, please note that this site will not do your work. Please show some effort - what have you tried? Have you done research? – Mangesh Apr 17 '17 at 07:25

1 Answers1

0

You need to create a new Window class. You can design that then any way you want. You can create and show a window modally like this:

MyWindow popup = new MyWindow();
popup.ShowDialog();

You can add a custom property for your result value, or if you only have two possible results ( + possibly undeterminate, which would be null), you can set the window's DialogResult property before closing it and then check for it (it is the value returned by ShowDialog()).

Zaheer Ul Hassan
  • 771
  • 9
  • 24