本文整理汇总了C#中NavigationParameters.Add方法的典型用法代码示例。如果您正苦于以下问题:C# NavigationParameters.Add方法的具体用法?C# NavigationParameters.Add怎么用?C# NavigationParameters.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NavigationParameters
的用法示例。
在下文中一共展示了NavigationParameters.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Address
private void Address()
{
var navigationParameters = new NavigationParameters();
var data = employeeService.GetAll();
navigationParameters.Add("DataToDisplay", data.GetHashCode().ToString());
AppParameters.Save(data.GetHashCode(), data);
navigationParameters.Add("ReportPath", @"Reports\EmployeeAddressBook.rdlc");
//navigationParameters.Add("Parameters",);
navigationParameters.Add("ReportDataSourceName", "EmployeeAddressBook");
this.regionManager.RequestNavigate(RegionNames.WorkingArea,
new Uri("ReportWindowView" + navigationParameters.ToString(), UriKind.Relative));
}
示例2: Navigate
void Navigate()
{
NavigationParameters parameters = new NavigationParameters();
parameters.Add("message", "Message from MainPage");
_navigationService.Navigate("ViewA", parameters);
}
示例3: Navigate
private void Navigate()
{
var navParams = new NavigationParameters();
navParams.Add("timestamp", DateTime.Now);
_navigationService.Navigate("ViewB", navParams);
}
示例4: ParametersParsedFromNavigationParametersInAbsoluteUri
public void ParametersParsedFromNavigationParametersInAbsoluteUri()
{
var navParameters = new NavigationParameters();
navParameters.Add("id", 3);
navParameters.Add("name", "brian");
var parameters = UriParsingHelper.GetSegmentParameters("http://www.brianlagunas.com/MainPage" + navParameters.ToString());
Assert.NotEmpty(parameters);
Assert.Contains("id", parameters.Keys);
Assert.Contains("name", parameters.Keys);
Assert.Equal("3", parameters["id"]);
Assert.Equal("brian", parameters["name"]);
}
示例5: AddCustomerHandler
public void AddCustomerHandler()
{
var q = new NavigationParameters();
q.Add("id",-1);
regionManager.RequestNavigate(RegionNames.MainRegion, "CustomerAddUpdateView" + q.ToString());
}
示例6: WhenGivenDuplicateParametersThrowsArgumentException
public void WhenGivenDuplicateParametersThrowsArgumentException()
{
Assert.Throws<ArgumentException>(() =>
{
var parameters = new NavigationParameters(_uri);
parameters.Add("id", 3);
});
}
示例7: ParametersParsedFromNavigationParametersInAbsoluteUri
public void ParametersParsedFromNavigationParametersInAbsoluteUri()
{
var navParameters = new NavigationParameters();
navParameters.Add("id", 3);
navParameters.Add("name", "brian");
var uri = new Uri("http://www.google.com/MainPage" + navParameters.ToString(), UriKind.Absolute);
var parameters = UriParsingHelper.ParseQuery(uri);
Assert.NotEmpty(parameters);
Assert.Contains("id", parameters.Keys);
Assert.Contains("name", parameters.Keys);
Assert.Equal("3", parameters["id"]);
Assert.Equal("brian", parameters["name"]);
}
示例8: Click
private void Click()
{
var parameters = new NavigationParameters();
parameters.Add("Message", "A message from ViewA");
//uses the overload to navigate using a class as the key
//when navigating within a NavigationPage, set useModalNavigation = false
NavigationService.Navigate<ViewCViewModel>(parameters);
}
示例9: Edit
public void Edit()
{
if (SelectedCustomer != null )
{
var q = new NavigationParameters();
q.Add("id", SelectedCustomer.CustomerID.ToString());
regionManager.RequestNavigate(RegionNames.MainRegion, "CustomerAddUpdateView" + q.ToString());
//regionManager.RegisterViewWithRegion(RegionNames.MainRegion, typeof(CustomerAddUpdateView));
}
}
示例10: OnSelectedFeedItem
/// <summary>
/// Called when a feed item is selected.
/// </summary>
/// <param name="selectedFeedItem">The selected feed item.</param>
protected override void OnSelectedFeedItem(FeedItemViewModel selectedFeedItem)
{
var navigationParameters = new NavigationParameters();
navigationParameters.Add("SelectedFeedItem", selectedFeedItem);
var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
regionManager.RequestNavigate(
RegionNames.RSSFeedReader,
new Uri(typeof(LabsFeedReaderView).Name, UriKind.Relative),
navigationParameters);
}
示例11: GoToBillableHoursEmp
private void GoToBillableHoursEmp(object sender, RoutedEventArgs e)
{
var navigationParameters = new NavigationParameters();
Mapper.CreateMap<WorkHour, BasicWorkHourVM>();
Mapper.CreateMap<Employee, BasicEmployeeVM>();
Mapper.CreateMap<WorkCode, BasicWorkCodeVM>();
var data = workHourService.GetReport().Where(a => a.WorkCode.Billable == true).ToList();
var bworkhours = new List<BasicWorkHourVM>();
foreach (WorkHour wh in data)
{
bworkhours.Add(Mapper.Map<WorkHour, BasicWorkHourVM>(wh));
}
navigationParameters.Add("DataToDisplay", bworkhours.GetHashCode().ToString());
AppParameters.Save(bworkhours.GetHashCode(), bworkhours);
navigationParameters.Add("ReportPath", @"Reports\HoursByEmployee.rdlc");
//navigationParameters.Add("Parameters",);
navigationParameters.Add("ReportDataSourceName", "HoursByEmployee");
this.regionManager.RequestNavigate(RegionNames.WorkingArea,
new Uri("ReportWindowView" + navigationParameters.ToString(), UriKind.Relative));
}
示例12: RequestNavigateToModuleSpecificView
/// <summary>
/// Navigates the specified region manager to the main view of a specified Prism module.
/// </summary>
/// <param name="regionManager">The region manager that this extension method effects.</param>
/// <param name="regionName">The name of the region to call Navigate on.</param>
/// <param name="moduleName">The name of the module to display.</param>
/// <param name="parameters">The navigation parameters.</param>
public static void RequestNavigateToModuleSpecificView(this IRegionManager regionManager, string regionName, string moduleName, Dictionary<string, string> parameters)
{
if (String.IsNullOrWhiteSpace(moduleName))
throw new ArgumentException(StevenVolckaert.Properties.Resources.ValueNullEmptyOrWhiteSpace, "moduleName");
var navigationParameters = new NavigationParameters();
if (parameters != null && parameters.Count > 0)
foreach (KeyValuePair<string, string> parameter in parameters)
navigationParameters.Add(parameter.Key, parameter.Value);
var uri = new Uri("/" + moduleName.Replace("Module", "View") + navigationParameters, UriKind.Relative);
regionManager.RequestNavigate(regionName, uri);
}
示例13: OpenMeetingEmail
private void OpenMeetingEmail(Meeting meeting)
{
// todo: 12 - Opening an email
//
// This view initiates navigation using the RegionManager.
// The RegionManager will find the region and delegate the
// navigation request to the region specified.
//
// This navigation request also includes additional navigation context, an 'EmailId', to
// allow the Email view to orient to the right item.
var parameters = new NavigationParameters();
parameters.Add(EmailIdName, meeting.EmailId.ToString(GuidNumericFormatSpecifier));
this.regionManager.RequestNavigate(RegionNames.MainContentRegion, new Uri(EmailViewName + parameters, UriKind.Relative));
}
示例14: OnSelectedChannel
/// <summary>
/// Called when a channel is selected.
/// </summary>
/// <param name="selectedChannelName">The name of the selected channel.</param>
protected override void OnSelectedChannel(string selectedChannelName)
{
if (selectedChannelName != ChannelNames.QANews)
{
this.IsChecked = false;
return;
}
var regionManager = ServiceLocator.Current.GetInstance<IRegionManager>();
var navigationParameters = new NavigationParameters();
navigationParameters.Add("Feed", this.Feed);
regionManager.RequestNavigate(
RegionNames.RSSFeeds,
new Uri(typeof(QANewsFeedsView).Name, UriKind.Relative),
navigationParameters);
}
示例15: WhenCreatingANewContextForAUriWithAQueryAndNavigationParameters_NoDuplicateParametersAreCreated
public void WhenCreatingANewContextForAUriWithAQueryAndNavigationParameters_NoDuplicateParametersAreCreated()
{
var uri = new Uri("test?name=value", UriKind.Relative);
var navParameters = new NavigationParameters();
navParameters.Add("name", "value");
var navigationJournalMock = new Mock<IRegionNavigationJournal>();
var navigationServiceMock = new Mock<IRegionNavigationService>();
IRegion region = new Region();
navigationServiceMock.SetupGet(n => n.Region).Returns(region);
navigationServiceMock.SetupGet(x => x.Journal).Returns(navigationJournalMock.Object);
var context = new NavigationContext(navigationServiceMock.Object, uri, navParameters);
Assert.AreEqual(uri, context.Uri);
Assert.AreEqual(1, context.Parameters.Count());
Assert.AreEqual("value", context.Parameters["name"]);
}