/// <summary> /// 画面遷移時に呼ばれる /// </summary> public void ChangeScreenView(string ViewClassName, object[] data) { try { if (ViewClassName == "TopView") { this.ChangeTopView(); } else { // 今表示している画面を戻る用にスタック if (NowView != null) { ViewStack.Push(NowView); } // 新しい画面を取得 NowView = (BaseView)Type.GetType("pluspoint.View." + ViewClassName).InvokeMember(null, System.Reflection.BindingFlags.CreateInstance, null, null, null); // 前の画面から受け取ったデータを次の画面へ設定 if (data != null) { NowView.ScreenData = data; } // 新しい画面から各種イベントを受け取るための設定 EventRegistration(); // 新規の画面なのでCreateViewを呼ぶ NowView.CreateView(); // 新しい画面に遷移 EventScreenView(this, EventArgs.Empty); } } catch { throw; } }
/// <summary> /// Top画面へ遷移 /// </summary> public void ChangeTopView() { // 現在画面の終了 if (NowView != null) { NowView.Dispose(); NowView = null; } // 画面表示をTOPに変更 NowView = new TopView(); // イベントを設定 EventRegistration(); // 新規の画面なのでCreateViewを呼ぶ NowView.CreateView(); // TOP画面へ更新 EventScreenView(this, EventArgs.Empty); // スタッククリア(各画面開放) ViewStack.Clear(); }