Answered by:
Navigation Scenario : How to share Common Data between Pages

Question
-
Hi,
In have 3 pages. I have a text box and Combobox with the values common to all the Pages
I will be setting textbox and Combobox with values in Page1.
I want this textbox and Combobox with value set in Page1 to get displayed in Page2Page3
How this can be done?
Please advice
Regards,
MuthuPalanivelTuesday, April 21, 2009 4:34 AM
Answers
-
Hello,
I have not worked with pages too much, but it seems like you have to create three TextBoxes and three ComboBoxes, one for each page, and then bind them together so they all show the same value.
As far as I know you can not show the control as shared on each page.
Good luck! I hope this helps.
noorbakhsh- Proposed as answer by noorbakhsh Tuesday, April 21, 2009 5:10 AM
- Marked as answer by Hua Chen Monday, April 27, 2009 5:43 AM
Tuesday, April 21, 2009 5:09 AM -
Hi,
I'm just trying to figure out a general solution to this problem. Not finished yet, but I can tell you so much: forget solution 1), it won't work. What you want to do is solution 2), so you need some place where both pages can access the object you want to bind to. Although this is not ideal, you could create a static property in some class (e.g. the application class), and use something like DataContext="{x:Static myNamespace:Application.MySharedObject}" in order to access it.- Marked as answer by Hua Chen Monday, April 27, 2009 5:43 AM
Tuesday, April 21, 2009 10:09 AM
All replies
-
Hello,
I have not worked with pages too much, but it seems like you have to create three TextBoxes and three ComboBoxes, one for each page, and then bind them together so they all show the same value.
As far as I know you can not show the control as shared on each page.
Good luck! I hope this helps.
noorbakhsh- Proposed as answer by noorbakhsh Tuesday, April 21, 2009 5:10 AM
- Marked as answer by Hua Chen Monday, April 27, 2009 5:43 AM
Tuesday, April 21, 2009 5:09 AM -
Hi,
First of all thanks for your concerned reply
I have 2 options in front of me - I dont know the possiblities of them
1) Share a Common TextBox and ComboBox between 3 pages --- OR ----
2) Have Individual text box and comboboxes but the datasource/databinding set to one
I haven't worked with databinding between pages
It will be great if I can have a sample
Thanks in Advance,
MuthuPalanivelTuesday, April 21, 2009 8:26 AM -
Hi,
I'm just trying to figure out a general solution to this problem. Not finished yet, but I can tell you so much: forget solution 1), it won't work. What you want to do is solution 2), so you need some place where both pages can access the object you want to bind to. Although this is not ideal, you could create a static property in some class (e.g. the application class), and use something like DataContext="{x:Static myNamespace:Application.MySharedObject}" in order to access it.- Marked as answer by Hua Chen Monday, April 27, 2009 5:43 AM
Tuesday, April 21, 2009 10:09 AM