本文整理汇总了C#中NavigationParameters类的典型用法代码示例。如果您正苦于以下问题:C# NavigationParameters类的具体用法?C# NavigationParameters怎么用?C# NavigationParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NavigationParameters类属于命名空间,在下文中一共展示了NavigationParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayViewInSplitPanel
public void DisplayViewInSplitPanel(string url, NavigationParameters parameter)
{
Action operation = () =>
{
var uri = new Uri(url, UriKind.Relative);
_loadedEdgePanel = (FrameworkElement)Application.LoadComponent(uri);
_loadedEdgePanel.Loaded += (sender, evt) => SplitterPanelLoaded(sender, evt, parameter);
_splitWindowContent.Children.Clear();
var contains = _splitWindowContent.Children.Contains(_loadedEdgePanel);
_splitWindowContent.Children.Add(_loadedEdgePanel);
// Force the metro window to calculate the size of the user control.
_loadedEdgePanel.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
_splitWindowContent.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
_splitWindow.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
DisplayEdgePanel();
};
if (_isEdgePanelOpen)
{
HideEdgePanel(operation);
}
else
{
operation();
}
}
示例2: OnNavigatedFrom
public override void OnNavigatedFrom(NavigationParameters parameters)
{
Loader.CancelLoading();
ListLoader.CancelLoading();
base.OnNavigatedFrom(parameters);
}
示例3: GoBackAsync
/// <summary>
/// Navigates to the most recent entry in the back navigation history by popping the calling Page off the navigation stack.
/// </summary>
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PopModalAsync, if <c>false</c> uses PopAsync</param>
/// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
/// <returns>If <c>true</c> a go back operation was successful. If <c>false</c> the go back operation failed.</returns>
public virtual async Task<bool> GoBackAsync(NavigationParameters parameters = null, bool? useModalNavigation = null, bool animated = true)
{
try
{
var page = GetCurrentPage();
var segmentParameters = GetSegmentParameters(null, parameters);
var canNavigate = await CanNavigateAsync(page, segmentParameters);
if (!canNavigate)
return false;
bool useModalForDoPop = UseModalNavigation(page, useModalNavigation);
Page previousPage = GetOnNavigatedToTarget(page, useModalForDoPop);
OnNavigatedFrom(page, segmentParameters);
var poppedPage = await DoPop(page.Navigation, useModalForDoPop, animated);
if (poppedPage != null)
{
OnNavigatedTo(previousPage, segmentParameters);
return true;
}
}
catch (Exception e)
{
_logger.Log(e.ToString(), Category.Exception, Priority.High);
return false;
}
return false;
}
示例4: Navigate
void Navigate()
{
NavigationParameters parameters = new NavigationParameters();
parameters.Add("message", "Message from MainPage");
_navigationService.Navigate("ViewA", parameters);
}
示例5: RequestNavigate
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="navigation">The navigation object.</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 INavigateAsync navigation, string target, NavigationParameters navigationParameters)
{
if (navigation == null) throw new ArgumentNullException("navigation");
if (target == null) throw new ArgumentNullException("target");
navigation.RequestNavigate(new Uri(target, UriKind.RelativeOrAbsolute), nr => { }, navigationParameters);
}
示例6: RequestNavigate
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="target"/>.
/// </summary>
/// <param name="navigation">The navigation object.</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 INavigateAsync navigation, Uri target, NavigationParameters navigationParameters)
{
if (navigation == null)
throw new ArgumentNullException(nameof(navigation));
navigation.RequestNavigate(target, nr => { }, navigationParameters);
}
示例7: OnNavigatedTo
public void OnNavigatedTo(NavigationParameters parameters)
{
Debug.WriteLine("-------------MainPageViewModel----------OnNavigatedTo <--");
if (parameters.ContainsKey("title"))
Title = (string)parameters["title"] + " and Prism";
}
示例8: Navigate
private void Navigate()
{
var navParams = new NavigationParameters();
navParams.Add("timestamp", DateTime.Now);
_navigationService.Navigate("ViewB", navParams);
}
示例9: NavigationContext
/// <summary>
/// Initializes a new instance of the <see cref="NavigationContext"/> class for a region name and a
/// <see cref="Uri"/>.
/// </summary>
/// <param name="navigationService">The navigation service.</param>
/// <param name="navigationParameters">The navigation parameters.</param>
/// <param name="uri">The Uri.</param>
public NavigationContext(IRegionNavigationService navigationService, Uri uri, NavigationParameters navigationParameters)
{
NavigationService = navigationService;
Uri = uri;
Parameters = uri != null ? UriParsingHelper.ParseQuery(uri) : null;
GetNavigationParameters(navigationParameters);
}
示例10: Init
public async Task Init(NavigationParameters parameters)
{
bool successful = await SafeOperation(
TaskEx.Run(async () => Sponsor = await _campService.GetSponsor(parameters.Id)));
FinishedLoading(successful);
}
示例11: WhenGivenDuplicateParametersThrowsArgumentException
public void WhenGivenDuplicateParametersThrowsArgumentException()
{
Assert.Throws<ArgumentException>(() =>
{
var parameters = new NavigationParameters(_uri);
parameters.Add("id", 3);
});
}
示例12: OnNavigatedTo
public override void OnNavigatedTo(NavigationParameters parameters)
{
base.OnNavigatedTo(parameters);
Issue = new IssueViewModel(parameters[Constants.IssueParameterName] as IIssue);
_repo = parameters[Constants.RepoParameterName] as IRepo;
Title = string.Format(LogWork.IssueTitle, Issue.Number);
}
示例13: AddCustomerHandler
public void AddCustomerHandler()
{
var q = new NavigationParameters();
q.Add("id",-1);
regionManager.RequestNavigate(RegionNames.MainRegion, "CustomerAddUpdateView" + q.ToString());
}
示例14: 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);
}
示例15: CanNavigate
public bool CanNavigate(NavigationParameters parameters)
{
OnConfirmNavigationCalled = true;
if (parameters.ContainsKey("canNavigate"))
return (bool)parameters["canNavigate"];
return true;
}