本文介紹了WPF 的現代 UI-導航的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
如何傳遞參數 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-導航的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!