Call NavigationService from Silverlight UserControl that contains Navigation Frame -
i have usercontrol contains frame urimapper. rootvisual, loaded when application loaded. (simplified) xaml:
<usercontrol> <navigation:frame x:name="contentframe" source="/page1"> <navigation:frame.urimapper> <urimapper:urimapper> <urimapper:urimapping uri="" mappeduri="/views/home.xaml"/> <urimapper:urimapping uri="/{pagename}" mappeduri="/views/{pagename}.xaml"/> </urimapper:urimapper> </navigation:frame.urimapper> </navigation:frame> <hyperlinkbutton x:name="page1link" navigateuri="/page1" targetname="contentframe" content="page1"/> <hyperlinkbutton x:name="page2link" navigateuri="/page2" targetname="contentframe" content="page2"/> </usercontrol>
this works great, want add back-button. when user clicks button, want call
navigationservice.goback();
i can call navigationservice pages (page1 , page2), how can call navigationservice 'parent' usercontrol? possible? in usercontrol, navigationservice null.
i either want access navigationservice pages shown in frame, or pass button click event these pages.
i don't want have put button in each page , handle navigation there.
try using
contentframe.navigate(your_uri);
and
contentframe.goback();
in parent usercontrol contains navigation frame x:name="contentframe".
Comments
Post a Comment