Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start the WPF window from console programmatically?

Tags:

wpf

I have a WPF window, I want to know if I can start it from a console programmatically?

like image 831
user496949 Avatar asked Dec 22 '10 13:12

user496949


People also ask

How do I display a WPF window?

When a Window is created at run-time using the Window object, it is not visible by default. To make it visible, we can use Show or ShowDialog method. Show method of Window class is responsible for displaying a window.


2 Answers

Hi You can use Application Class, with the help of this class,we can start wpf window programmatically,

Application app = new Application ();
app.Run(new Window1());
like image 64
Sankar Ganesh PMP Avatar answered Sep 24 '22 11:09

Sankar Ganesh PMP


Use the Application class:

new Application().Run(new SomeWindow());
like image 27
SLaks Avatar answered Sep 25 '22 11:09

SLaks