-1

So I am developing a two-screen application using wpf with mvvm light. I want to mirror them as much as possible. However, I run into problem with the showdialog for windows. Because ShowDialog will put the dialog window into focus and require the user to interact with it first, I cannot create another copy of it on another the second screen. Is there anyway I can create two identical dialog window showing up at the same time?

Thank you so much for your help!

kjaydenle
  • 1
  • 2

2 Answers2

1

Instead of ShowDialog() use Show() which displays the window in a non-modal way.

San
  • 11
  • 2
-1

May be TaskDialog where the trick to go modeless is IntPtr.Zero for owner parameter. There may be one issue, as shown below the dialog will be center screen while using a third parameter you can set the owner e.g. a button for instance or other control. So this may or may not work for you.

public static void InformationModeless( string heading, string buttonText = "Ok")
{

    TaskDialogButton okayButton = new(buttonText);

    TaskDialogPage page = new()
    {
        Caption = "Information",
        SizeToContent = true,
        Heading = heading,
        Buttons = new TaskDialogButtonCollection() { okayButton }
    };

    TaskDialog.ShowDialog(IntPtr.Zero, page);

}
Karen Payne
  • 4,341
  • 2
  • 14
  • 31