/// <summary>SelectedItemChangedイベントハンドラ。</summary> /// <param name="e">イベントデータを格納しているRoutedPropertyChangedEventArgs<object>。</param> private void nodeChanged(RoutedPropertyChangedEventArgs <object> e) { var viewName = string.Empty; var current = e.NewValue as TreeViewItemViewModel; switch (current.SourceData) { case PersonalInformation p: viewName = "PersonalEditor"; break; case PhysicalInformation p: viewName = "PhysicalEditor"; break; case TestPointInformation t: viewName = "TestPointEditor"; break; case string s: viewName = "CategoryPanel"; break; } var param = new Prism.Regions.NavigationParameters(); param.Add("TargetData", current.SourceData); this.regionManager.RequestNavigate("EditorArea", viewName, param); }
private void DobleClick(PresupuestoDto obj) { if (obj != null) { var nav = new Prism.Regions.NavigationParameters(); nav.Add("Presupuesto", obj); regionManager.RequestNavigate("Contenido", "PresupuestoDetalle", nav); eventAggregator.GetEvent <PubSubEvent <Visibility> >().Publish(Visibility.Collapsed); } }
/// <summary>SelectedItemChangedイベントハンドラ。</summary> /// <param name="e">イベントデータを格納しているRoutedPropertyChangedEventArgs<object>。</param> private void nodeChanged(RoutedPropertyChangedEventArgs <object> e) { if (this.skipNodeChange) { this.skipNodeChange = false; return; } var viewName = string.Empty; var current = e.NewValue as TreeViewItemViewModel; switch (current.SourceData) { case PersonalInformation p: viewName = "PersonalEditor"; break; case PhysicalInformation p: viewName = "PhysicalEditor"; break; case TestPointInformation t: viewName = "TestPointEditor"; break; case string s: viewName = "CategoryPanel"; break; } var param = new Prism.Regions.NavigationParameters(); param.Add("TargetData", current.SourceData); this.regionManager.RequestNavigate("EditorArea", viewName, r => { if ((r.Result.HasValue) && (!r.Result.Value)) { var oldNode = e.OldValue as TreeViewItemViewModel; this.skipNodeChange = true; oldNode.IsSelected.Value = true; } }, param); }
/// <summary> /// This method allows an IRegionManager to locate a specified region and navigate in it to the specified target string, passing an instance of NavigationParameters, which holds a collection of object parameters. /// </summary> /// <param name="regionManager">The IRegionManager instance that is extended by this method.</param> /// <param name="regionName">The name of the region where the navigation will occur.</param> /// <param name="target">A string that represents the target where the region will navigate.</param> /// <param name="navigationParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param> public static void RequestNavigate(this IRegionManager regionManager, string regionName, string target, NavigationParameters navigationParameters) { RequestNavigate(regionManager, regionName, new Uri(target, UriKind.RelativeOrAbsolute), nr => { }, navigationParameters); }
/// <summary> /// This method allows an IRegionManager to locate a specified region and navigate in it to the specified target Uri, passing an instance of NavigationParameters, which holds a collection of object parameters. /// </summary> /// <param name="regionManager">The IRegionManager instance that is extended by this method.</param> /// <param name="regionName">The name of the region where the navigation will occur.</param> /// <param name="target">A Uri that represents the target where the region will navigate.</param> /// <param name="navigationParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param> public static void RequestNavigate(this IRegionManager regionManager, string regionName, Uri target, NavigationParameters navigationParameters) { RequestNavigate(regionManager, regionName, target, nr => { }, navigationParameters); }
/// <summary> /// This method allows an IRegionManager to locate a specified region and navigate in it to the specified target string, passing a navigation callback and an instance of NavigationParameters, which holds a collection of object parameters. /// </summary> /// <param name="regionManager">The IRegionManager instance that is extended by this method.</param> /// <param name="regionName">The name of the region where the navigation will occur.</param> /// <param name="target">A string that represents the target where the region will navigate.</param> /// <param name="navigationCallback">The navigation callback that will be executed after the navigation is completed.</param> /// <param name="navigationParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param> public static void RequestNavigate(this IRegionManager regionManager, string regionName, string target, Action <NavigationResult> navigationCallback, NavigationParameters navigationParameters) { RequestNavigate(regionManager, regionName, new Uri(target, UriKind.RelativeOrAbsolute), navigationCallback, navigationParameters); }
/// <summary> /// This method allows an IRegionManager to locate a specified region and navigate in it to the specified target Uri, passing a navigation callback and an instance of NavigationParameters, which holds a collection of object parameters. /// </summary> /// <param name="regionManager">The IRegionManager instance that is extended by this method.</param> /// <param name="regionName">The name of the region where the navigation will occur.</param> /// <param name="target">A Uri that represents the target where the region will navigate.</param> /// <param name="navigationCallback">The navigation callback that will be executed after the navigation is completed.</param> /// <param name="navigationParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param> public static void RequestNavigate(this IRegionManager regionManager, string regionName, Uri target, Action <NavigationResult> navigationCallback, NavigationParameters navigationParameters) { if (regionManager == null) { return; } if (regionManager.Regions.ContainsRegionWithName(regionName)) { regionManager.Regions[regionName].RequestNavigate(target, navigationCallback, navigationParameters); } }
/// <summary> /// This method allows an IRegionManager to locate a specified region and navigate in it to the specified target Uri, passing an instance of NavigationParameters, which holds a collection of object parameters. /// </summary> /// <param name="regionName">The name of the region where the navigation will occur.</param> /// <param name="target">A Uri that represents the target where the region will navigate.</param> /// <param name="navigationParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param> public void RequestNavigate(string regionName, Uri target, NavigationParameters navigationParameters) { RequestNavigate(regionName, target, nr => { }, navigationParameters); }
/// <summary> /// This method allows an IRegionManager to locate a specified region and navigate in it to the specified target Uri, passing a navigation callback and an instance of NavigationParameters, which holds a collection of object parameters. /// </summary> /// <param name="regionName">The name of the region where the navigation will occur.</param> /// <param name="target">A Uri that represents the target where the region will navigate.</param> /// <param name="navigationCallback">The navigation callback that will be executed after the navigation is completed.</param> /// <param name="navigationParameters">An instance of NavigationParameters, which holds a collection of object parameters.</param> public void RequestNavigate(string regionName, Uri target, Action <NavigationResult> navigationCallback, NavigationParameters navigationParameters) { if (navigationCallback == null) { throw new ArgumentNullException(nameof(navigationCallback)); } if (Regions.ContainsRegionWithName(regionName)) { Regions[regionName].RequestNavigate(target, navigationCallback, navigationParameters); } else { navigationCallback(new NavigationResult(new NavigationContext(null, target, navigationParameters), false)); } }
private void DoNavigate(Uri source, Action <NavigationResult> navigationCallback, NavigationParameters navigationParameters) { if (source == null) { throw new ArgumentNullException(nameof(source)); } if (this.Region == null) { throw new InvalidOperationException(Resources.NavigationServiceHasNoRegion); } this.currentNavigationContext = new NavigationContext(this, source, navigationParameters); // starts querying the active views RequestCanNavigateFromOnCurrentlyActiveView( this.currentNavigationContext, navigationCallback, this.Region.ActiveViews.ToArray(), 0); }
/// <summary> /// Initiates navigation to the specified target. /// </summary> /// <param name="target">The target.</param> /// <param name="navigationCallback">A callback to execute when the navigation request is completed.</param> /// <param name="navigationParameters">The navigation parameters specific to the navigation request.</param> public void RequestNavigate(Uri target, Action <NavigationResult> navigationCallback, NavigationParameters navigationParameters) { if (navigationCallback == null) { throw new ArgumentNullException(nameof(navigationCallback)); } try { this.DoNavigate(target, navigationCallback, navigationParameters); } catch (Exception e) { this.NotifyNavigationFailed(new NavigationContext(this, target), navigationCallback, e); } }