728x90
반응형
728x170
▶ MainWindow.cs
using System;
using System.IO;
using System.Windows;
using System.Windows.Markup;
using System.Windows.Media;
using System.Xml;
namespace TestProject
{
/// <summary>
/// 메인 윈도우
/// </summary>
public class MainWindow : Window
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainWindow()
/// <summary>
/// 생성자
/// </summary>
public MainWindow()
{
Width = 800;
Height = 600;
Title = "내장 XAML 로드하기";
FontFamily = new FontFamily("나눔고딕코딩");
FontSize = 16;
string xaml = @"
<Button
xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
Foreground='LightSeaGreen'
FontSize='24pt'>
Click me!
</Button>";
StringReader stringReader = new StringReader(xaml);
XmlTextReader xmlTextReader = new XmlTextReader(stringReader);
object instance = XamlReader.Load(xmlTextReader);
Content = instance;
}
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Static
//////////////////////////////////////////////////////////////////////////////// Public
#region 프로그램 시작하기 - Main()
/// <summary>
/// 프로그램 시작하기
/// </summary>
[STAThread]
public static void Main()
{
Application application = new Application();
application.Run(new MainWindow());
}
#endregion
}
}
728x90
반응형
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] XAML 문서 리더 만들기 (0) | 2018.03.24 |
---|---|
[C#/WPF] Content 속성 어트리뷰트 출력하기 (0) | 2018.03.24 |
[C#/WPF] XAML 동적 생성하기 (0) | 2018.03.24 |
[C#/WPF] XAML 윈도우 로드하기 (0) | 2018.03.24 |
[C#/WPF] XAML 리소스 로드하기 (0) | 2018.03.24 |
[C#/WPF] 내장 XAML 로드하기 (0) | 2018.03.24 |
[C#/WPF] 메모장 흉내내기 (0) | 2018.03.24 |
[C#/WPF] 의존 속성 탐색하기 (0) | 2018.03.24 |
[C#/WPF] 시스템 매개 변수 조회하기 (0) | 2018.03.24 |
[C#/WPF] 클래스 계층도 표시하기 (0) | 2018.03.24 |
[C#/WPF] TreeView 클래스 사용하기 (0) | 2018.03.24 |
댓글을 달아 주세요