xaml - C# - wp8: change textblock content by dynamically? -


i have several html files in app. displayed through webbrowser. stored current displaying page's number string page. wanna display page name in textblock. so, have stored text string's. example

string chapter1 = "welcome page"; string chapter2 = "about us"; //...// 100 strings 

if welcome page displayed in webbrowser, string page 1. using string page string chapter1 should filename.text likewise wanna display. but, dunno how so. best answers appreciated.

c# code;

textblock filename = new textblock(); filename.margin = new thickness(0); filename.fontsize = 30; filename.foreground = new solidcolorbrush(colors.white); filename.textalignment = textalignment.center; filename.text = "???"; 

if xaml controls labelled [have name tag], can call them c# this:

xaml:

<textblock name="filename" margin="0,0,10,0" fontsize="30" foreground="white" textalignment="center" /> <phone:webbrowser x:name="browser" isscriptenabled="true" /><br> 


c#: [assuming have button]

btn_click+=(s, args) => { filename.text="newtext"; } 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -