This is a migrated thread and some comments may be shown as answers.

Question about Frame controls

3 Answers 111 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Leo
Top achievements
Rank 2
Leo asked on 01 Nov 2010, 07:55 AM
Hello, here's the scenario.

I have a Telerik Window and I have divided it's content to two parts. Left frame and Right frame using Frame Controls. I navigated to the left frame (LeftPage.xaml) by NavigationServices, same as the right frame (RightPage.xaml). Is there a possible way to get the current data that is loaded from the LeftPage.xaml to the RightPage.xaml?

For example: In my behind the code in LeftPage.xaml, I have a code that says textBox1.text = textBox2.text; so normally when I type in the left page on the textbox2 it will automatically get the current data that is being inputted to textbox1. Now my question is it possible to get the current data in textbox2 to the RightPage textbox3?

I tried binding it but it did not work, I tried instantiating the RightPage and access the textbox3 but it still wont work. It basically does not even let me do a evenet on another page from the original page. Am I doing something wrong? 

3 Answers, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 03 Nov 2010, 02:10 PM
Hello Leo,

 Your really best option is to have shared (let's say ViewModel) object that the one page is bound to and the second page is bound to. So at the end you can synchronize (share data between them) using this object. It will be as easy as setting the DataContext of the UserControl to that object and bind what you need to properties of it.
If you need more help, please let us know.

All the best,
Miro Miroslavov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Leo
Top achievements
Rank 2
answered on 03 Nov 2010, 05:46 PM
Hello, could you provide me a code how to implement MVVM pattern if it's okay? Thanks!
0
Kiril Stanoev
Telerik team
answered on 09 Nov 2010, 10:46 AM
Hello Leo,

 Sorry for the delayed reply. There are various resources on the net on how to implement MVVM with WPF. However, I'd suggest you start by reading the articles bellow:

MVVM: Tutorial from start to finish?

A Practical Quick-start Tutorial on MVVM in WPF

Silverlight 4.0 and MVVM Pattern (even though it is for Silverlight, it is easily reusable for WPF)

Greetings,
Kiril Stanoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Leo
Top achievements
Rank 2
Answers by
Miro Miroslavov
Telerik team
Leo
Top achievements
Rank 2
Kiril Stanoev
Telerik team
Share this question
or