Created
January 14, 2015 08:04
-
-
Save hilapon/270ab7961e5ebf9d1dba to your computer and use it in GitHub Desktop.
WPF の Hello world (その3)
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; | |
using System.Windows.Controls; | |
namespace ConsoleApplication3 { | |
class Program { | |
[STAThread] | |
static void Main(string[] args) { | |
var window = new Window() { | |
Content = new TextBlock() { | |
Text = "Hello world" | |
} | |
}; | |
window.ShowDialog(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Window.Content に TextBlock を指定したサンプル。Window.Content プロパティには FrameworkElement 型のインスタンス以外にも、String や 値型のインスタンス、ヌル値等、様々なオブジェクトを設定できる。