Ravi
Ravi

Reputation: 173

Use text box in another page to edit code of a button?

I'm creating a web browser. On the "mainpage" it has a button that takes you to the homepage, i'd like to give the user the option of changing the home page on "page1" (settings). on page1 I have "textBox1"(where the user enter desired homepage) and "button1" (set). Could you help me set this up? Is there a way where doing that action can change the source of webBrowser1?

Upvotes: 1

Views: 125

Answers (1)

nkchandra
nkchandra

Reputation: 5557

First I would suggest you to download this Programming Windows Phone 7 ebook and explore it to learn Windows phone programming before asking StackOverflow.

Coming to your question,

Create a Settings class in the project and Add a static string property named something like "HomePageUri". Then in your Page1, add the source uri to that "HomePageUri".

Then in your main page, in the OnNavigatedTo event update the WebBrowser's source or you can bind the WebBrowser's source directly to the "HomePageUri" property

Good luck

Upvotes: 1

Related Questions