Created
January 14, 2015 06:56
-
-
Save hilapon/8f65dc9bfc48dd8697c6 to your computer and use it in GitHub Desktop.
WPF の Hello world (その2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Windows; | |
namespace ConsoleApplication3 { | |
class Program { | |
[STAThread] | |
static void Main(string[] args) { | |
var window = new Window() { Content = "Hello world" }; | |
window.ShowDialog(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
コンソールアプリからWPF Window を起動するサンプル。WPF Window の起動はシングルスレッドアパートメントでないと例外が発生するため、STAThread属性を指定してある。