c# - how can i take that page1.html paeg from mainpage.xaml to secondpage.xaml and show on webControl browser? -
i want show .html files isolatedstorage, files located in (mainfolder -> subfolder1 -> subfolder2 -> page1.html).
how can take page1.html page mainpage.xaml secondpage.xaml , show on webcontrol browser?
in brief:
my secondpage.xaml contains web browser control on want show page1.html mainpage.xaml, page located above storage location.
so have proper answer question. requirement take values isoalated storage form mainpage.xaml , show on secondpage.xaml's web-browser control. , wanted on selection image listbox control set on mainpage.xaml.
so code following along inline documentation have mentioned making out scenario.
**//mainpage.xaml.** private async void imgbookimage_tap(object sender, system.windows.input.gestureeventargs e) { //it way take id listview if showing listview through wrapper using observablecollection. mywrapper bookname = (mywrapper)this.listcloudbooks.selecteditem; isolatedstoragefile isf = isolatedstoragefile.getuserstoreforapplication(); string dir = "/mainfolder/subfolder/" + bookname.id; if (isf.directoryexists(dir)) { navigationservice.navigate(new uri("/mainpage.xaml?selecteditem=" +bookname.id, urikind.relative));//bookname.id fetching id of book , through bookid id on our destination page , show data. } else { //in method creating folder of bookid , storing destination folder in isolated storage. not showing code of method because answering of question only. downloadbooks(bookname); }
}
//secondpage.xaml private void phoneapplicationpage_loaded(object sender, routedeventargs e) { string selectedbookid = "";//set variable globally. position = 1; isolatedstoragefile isf = isolatedstoragefile.getuserstoreforapplication(); string dir = "/mainfolder/subfolder/" + selectedbookid; string concatbookjson = string.concat(dir, "/pagerecords.json");//taking pagerecords.json, file have records of *.html pages showing isolatestorage if (isf.fileexists(concatbookjson)) { currentbook = getbookcontents(concatbookjson);//returning json deserialize data isolated storage. txtbookname.text = currentbook.title;//i have title property can access properties of wrapper class (mywrapper). } }
you should use onnavigated event fetching values mainpage.xaml, requirement different have shown in phoneapplciation_loaded event.
Comments
Post a Comment