public SettingWindow(MainWindow mw, PresenterWindow pw) { this.mw = mw; this.pw = pw; InitializeComponent(); SettingToControl(); }
public HelpWindow(MainWindow mw, PresenterWindow pw) { this.mw = mw; this.pw = pw; InitializeComponent(); TextBlockVersion.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
private void OpenPresenterWindow() { if (pw == null) { // PresenterWindow is not open pw = new PresenterWindow(this); pw.Show(); // event handler management (ko): https://msdn.microsoft.com/ko-kr/library/ms742806(v=vs.110).aspx pw.AddHandler(UnloadedEvent, new RoutedEventHandler(OnPwUnloaded)); UpdatePgm(); } else { MessageBox.Show("이미 송출 창이 열려 있습니다.\n이 메시지를 보고 있다면 개발자에게 알리십시오.", "TextPresenter51456"); } }
private void ClosePresenterWindow() { if (pw != null) { // PresenterWindow is already open pw.Close(); RoutedEventArgs rea = new RoutedEventArgs(UnloadedEvent) { Source = pw }; pw.RaiseEvent(rea); } else { MessageBox.Show("이미 송출 창이 닫혀 있습니다.\n이 메시지를 보고 있다면 개발자에게 알리십시오.", "TextPresenter51456"); pw = null; } }
// when PresenterWindow is unloaded, make pw null to check easily whether PresenterWindow is open private void OnPwUnloaded(object sender, RoutedEventArgs e) { pw = null; }