using System; using System.Windows; using System.Windows.Input; class MainClass: Application { [STAThread] public static void Main() { MainClass app = new MainClass(); app.Run(); } protected override void OnStartup(StartupEventArgs args) { Window winMain = new Window(); winMain.Title = "Main Window"; winMain.MouseDown += WindowOnMouseDown; winMain.Show(); } void WindowOnMouseDown(object sender, MouseButtonEventArgs args) { Window win = new Window(); win.Title = "Modal Dialog Box"; win.ShowDialog(); } }