As far as I know, you cannot do this. If you want to show it in a dialog box, thatβs fine, just create a new window that contains only your UserControl, and call ShowDialog () after instantiating this window.
EDIT: The UserControl class does not contain the ShowDialog method, so what you are trying to do is actually not possible.
This, however, is as follows:
private void Button_Click(object sender, RoutedEventArgs e){ new ContainerWindow().ShowDialog(); }
Mark Carpenter Aug 11 '09 at 18:25 2009-08-11 18:25
source share