C#/WPF
WPF tutorial - App.xaml로 작업하기
광그로
2017. 6. 20. 15:18
1 2 3 4 5 6 7 8 9 10 | <Application x:Class="WPF_tutorial.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WPF_tutorial" StartupUri="MainWindow.xaml"> : "MainWindow.xaml"이라는 Window 혹은 Page를 응용프로그램 구동 시 최초에 시작해라. <Application.Resources> </Application.Resources> </Application> | cs |
1 2 3 4 5 6 | <Application x:Class="WpfTutorialSamples.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Startup="Application_Startup"> StartupUri가 Startup으로 바뀌었습니다. <Application.Resources></Application.Resources> </Application> | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | using System; using System.Collections.Generic; using System.Windows; namespace WpfTutorialSamples { public partial class App : Application { private void Application_Startup(object sender, StartupEventArgs e) { // Create the startup window MainWindow wnd = new MainWindow(); // Do stuff here, e.g. to the window wnd.Title = "Something else"; // Show the window wnd.Show(); 시작 창을 표시하기 전에 시작 창을 조작한다는 이점이 있습니다. } } } |