Application 클래스
.NET프로그래밍/Silverlight 3.0 2009. 11. 24. 09:29 |
Application 클래스
- 실버라이트 응용 프로그램이 시작할 때 발생
- 실버라이트 응용 프로그램의 EntryPoint
- C#의 Main 메서드와 비슷한 역할
-------------------------------------------------------------------------------------
[App.xaml.cs]
public partial class App : Application
{
public App()
{
this.Startup += this.Application_Startup;
this.Exit += this.Application_Exit;
this.UnhandledException += this.Application_UnhandledException;
InitializeComponent();
}
private void Application_Startup(object sender, StartupEventArgs e)
{
// 실버라이트 응용프로그램의 시작점
//this.RootVisual = new MainPage();
this.RootVisual = new SubPage();
}
private void Application_Exit(object sender, EventArgs e)
{
}
-------------------------------------------------------------------------------------
[MainPage.xaml]
<Grid x:Name="LayoutRoot" Background="White">
<TextBlock x:Name="lblTitle" Text="Application Class"
FontSize="30"></TextBlock>
</Grid>
-------------------------------------------------------------------------------------
[SubPage.xaml]
<Grid x:Name="LayoutRoot" Background="White">
<TextBlock x:Name="lblTitle" Text="Sub Page!!!"
FontSize="30" FontFamily="Verdana"></TextBlock>
</Grid>
-------------------------------------------------------------------------------------
[실행결과]
'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글
실버라이트 1.0 개발 (0) | 2009.11.24 |
---|---|
수작업으로 실버라이트 배포 (RiaDeploy) (0) | 2009.11.24 |
RiaHelloWorld (0) | 2009.11.23 |
실버라이트 3.0 개발 환경 구축 (0) | 2009.11.23 |
Silverlight란? (0) | 2009.11.20 |