如何传递参数 beetwen 页面?我尝试将参数添加到页面 uri 但它不起作用,因为我无法在用户控件上使用 onNavigatedTo 事件.请帮忙
How can I pass parameter beetwen pages? I've tried to add parameters to page uri but it didn't work because I can't use onNavigatedTo event on user control. Please help
必须使用 OnFragmentNavigation.
You must use OnFragmentNavigation.
public void OnFragmentNavigation(FragmentNavigationEventArgs e)
{
DoYourStuff(e.Fragment)
}
e.Fragement 包含 URI 中 # 之后的所有内容.例如,使用
e.Fragement contains everything past the # in the URI. In example, using
NavigationCommands.GoToPage.Execute("/Pages/CustomerPage.xaml#CustomerID=12345", this);
e.Fragment 将为CustomerID=12345"
e.Fragment will be "CustomerID=12345"
这篇关于WPF 的现代 UI-导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!