app

    [WPF] 단일 인스턴트 응용 프로그램

    이미 실행중인 프로그램일때 새로운 응용프로그램은 종료시켜보자. 위와 같이 처리 후 아래와 같이 Mutex를 이용하여 같은 응용프로그램이 있는지 체크하여 실행/종료 using System.Windows; using System.Threading; namespace WpfApplication2 { /// /// App.xaml에 대한 상호 작용 논리 /// public partial class App : Application { Mutex mutex; protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); string mutexName = "InstanceName"; bool createdNew; mutex = new Mutex(..

    [WPF] App.xaml StartupUri -> cs사용

    App.xaml 파일을 보면 시작페이지를 지정하는 코드(StartupUri)가 있다. 이 부분을 cs파일에서 구현해보자. using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Windows; namespace WpfApplication3 { /// /// App.xaml에 대한 상호 작용 논리 /// public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); Window1 window =..