本文整理匯總了C#中Microsoft.Practices.Prism.Regions.NavigationContext類的典型用法代碼示例。如果您正苦於以下問題:C# NavigationContext類的具體用法?C# NavigationContext怎麽用?C# NavigationContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
NavigationContext類屬於Microsoft.Practices.Prism.Regions命名空間,在下文中一共展示了NavigationContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnNavigatedTo
public void OnNavigatedTo(NavigationContext navigationContext)
{
string ParametroRecibido = navigationContext.Parameters["TheText"];
// ReceptionTextBox.Text = ParametroRecibido; // este codigo es para una implantación con codebehinde
RecepcionDato = ParametroRecibido;
System.Windows.MessageBox.Show(String.Format("El parametro recibido es :/{0}/", ParametroRecibido));
}
示例2: OnNavigatedTo
public void OnNavigatedTo(NavigationContext navigationContext)
{
ViewModel = (MediaFileBrowserImagePanelViewModel)navigationContext.Parameters["viewModel"];
DataContext = ViewModel;
ViewModel.OnNavigatedTo(navigationContext);
}
示例3: OnNavigatedTo
public void OnNavigatedTo(NavigationContext navigationContext)
{
menu = new RTIMainView();
menu.AboutButton.Command = aboutCommand;
ribbonService.AddRibbonItem(menu, true);
}
示例4: OnNavigatedTo
/// <summary>
/// 當前的頁麵被導航到以後發生,這個函數可以用來處理URI的參數
/// </summary>
/// <param name="navigationContext"></param>
public void OnNavigatedTo(NavigationContext navigationContext)
{
if (TagMsg == null || TagMsg == "")
{
TagMsg = "密碼";
}
}
示例5: OnNavigatedFrom
public void OnNavigatedFrom(NavigationContext navigationContext)
{
foreach (var tabItem in _tabs)
{
tabItem.ViewModel.Deinitialize(navigationContext);
}
}
示例6: OnNavigatedTo
public void OnNavigatedTo(NavigationContext navigationContext)
{
if (navigationContext.Parameters != null && navigationContext.Parameters.Any())
{
var id = (int?) navigationContext.Parameters["Id"];
if (id.HasValue)
{
ViewModel = new DishViewModel(id.Value)
{
Repository = Repository
};
}
else
{
ViewModel = new DishViewModel
{
Repository = Repository
};
}
}
else
ViewModel = new DishViewModel
{
Repository = Repository
};
}
示例7: RaiseNavigating
private void RaiseNavigating(NavigationContext navigationContext)
{
if (this.Navigating != null)
{
this.Navigating(this, new RegionNavigationEventArgs(navigationContext));
}
}
示例8: RegionNavigationEventArgs
/// <summary>
/// Initializes a new instance of the <see cref="RegionNavigationEventArgs"/> class.
/// </summary>
/// <param name="navigationContext">The navigation context.</param>
public RegionNavigationEventArgs(NavigationContext navigationContext)
{
if (navigationContext == null) throw new ArgumentNullException("navigationContext");
Contract.EndContractBlock();
this.NavigationContext = navigationContext;
}
示例9: IsNavigationTarget
public bool IsNavigationTarget(NavigationContext navigationContext)
{
return true;
// If you want to create multiple versions of this view then you need to set the
// PartCreationPolicy to NonShared and write code to determine if the view is
// a navigation target or not.
}
示例10: WhenRegionHasMultipleViews_ThenViewsWithMatchingTypeNameAreConsidered
public void WhenRegionHasMultipleViews_ThenViewsWithMatchingTypeNameAreConsidered()
{
// Arrange
var serviceLocatorMock = new Mock<IServiceLocator>();
var region = new Region();
var view1 = new TestView();
var view2 = "view";
region.Add(view1);
region.Add(view2);
var navigationContext = new NavigationContext(null, new Uri(view2.GetType().Name, UriKind.Relative));
var navigationTargetHandler = new TestRegionNavigationContentLoader(serviceLocatorMock.Object);
// Act
var returnedView = navigationTargetHandler.LoadContent(region, navigationContext);
// Assert
Assert.AreSame(view2, returnedView);
}
示例11: OnNavigatedTo
public void OnNavigatedTo(NavigationContext navigationContext)
{
ViewModel = (ImageViewModel)navigationContext.Parameters["viewModel"];
DataContext = ViewModel;
ViewModel.OnNavigatedTo(navigationContext);
}
示例12: IsNavigationTarget
public bool IsNavigationTarget( NavigationContext navigationContext )
{
// Called to see if this view can handle the navigation request. If it can, this view is activated.
// This view is always the navigation target so return true.
return true;
}
示例13: OnNavigatedTo
public void OnNavigatedTo(NavigationContext navigationContext)
{
if (navigationContext.Parameters != null && navigationContext.Parameters.Any())
{
var dishes = navigationContext.Parameters["Dishes"] as List<DishViewModel>;
if (dishes != null)
ViewModel = new OrderViewModel(dishes)
{
Repository = Repository,
NavigationService = navigationContext.NavigationService
};
else
ViewModel = new OrderViewModel
{
Repository = Repository,
NavigationService = navigationContext.NavigationService
};
}
else
ViewModel = new OrderViewModel
{
Repository = Repository,
NavigationService = navigationContext.NavigationService
};
}
示例14: OnNavigatedTo
public void OnNavigatedTo(NavigationContext navigationContext)
{
_trackMenuBarToken = _eventAggregator.GetEvent<TrackCommandBarEvent>().Subscribe(OnTrackMenuBarEvent, true);
_tracksMenuBarToken = _eventAggregator.GetEvent<TracksCommandBarEvent>().Subscribe(OnTracksMenuBarEvent, true);
Album = navigationContext.Tag as IAlbum;
}
示例15: OnNavigatedTo
public void OnNavigatedTo(NavigationContext navigationContext)
{
ViewModel = (GeotagFileBrowserViewModel)navigationContext.Parameters["viewModel"];
DataContext = ViewModel;
ViewModel.OnNavigatedTo(navigationContext);
}