/// <summary> /// 遷移先画面イベント /// </summary> /// <param name="view">ビューインスタンス</param> /// <param name="args">引数</param> /// <param name="parameter">復帰情報</param> /// <param name="context">プラグインコンテキスト</param> private void ViewForwardTo(object view, ViewForwardEventArgs args, object parameter, ForwadingPluginContext context) { var target = provider.ResolveEventTarget(view); // プラグインイベント foreach (var plugin in Plugins) { plugin.OnNavigateTo(context, target); } // 遷移イベント var support = target as IViewEventSupport; if (support != null) { support.OnViewNavigated(args); } // 活性化 provider.ViewActive(view, parameter); // 活性化イベント if (support != null) { support.OnViewActived(args); } }
/// <summary> /// /// </summary> /// <param name="parameters"></param> /// <param name="updateStack"></param> /// <param name="postProcess"></param> private void DoInternalNavigate(IViewParameters parameters, Func <bool> updateStack, Action <object> postProcess) { // プラグインコンテキスト var pluginContext = new ForwadingPluginContext(); // 遷移元画面遷移イベント ViewForwardFrom(CurrentView, pluginContext); // 前状態 var previousViewId = CurrentViewId; var previousView = CurrentView; // スタック更新 var restore = updateStack(); // イベント var args = new ViewForwardEventArgs(CurrentViewId, previousViewId, previousView, parameters ?? EmptyParameters, restore); // ナビゲーターイベント if (Forwarding != null) { Forwarding(this, args); } // 遷移先画面遷移イベント ViewForwardTo(CurrentView, args, CurrentRestoreParameter, pluginContext); // 復帰情報クリア CurrentRestoreParameter = null; // 後処理 postProcess(previousView); }