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

Does Persistence framework persists bindings between the controls.

5 Answers 119 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jyothsna
Top achievements
Rank 1
Jyothsna asked on 16 May 2012, 06:40 AM
HI,

I have a colorpicker and a text box. Using MVVm pattern, Textbox is binded to a property called "CurrentSelectedColor" in viewmodel.
color picker 's dependecy property "selectedcolor" is also binded to the property "CurrentSelectedColor"  in view model .
 Now when I select any color from color picker , the selected colors gets into the background property of textbox.
Iam saving this into a stream using IsolatedStorageFile . This way my color settings are save to local xml file.After changing the color, Iam relaoding the saved settings. Once the color settings are reloaded , bindings are gone, the selected color in color picker is not getting updated to texbox.

How can we persists the bindings also between these 2 controls.

Regards,
Jyothsna.

5 Answers, 1 is accepted

Sort by
0
Jyothsna
Top achievements
Rank 1
answered on 16 May 2012, 07:26 AM
Hello Telerik ,

Can you pls clarify the above issue. Iam using RadColorpicker .
0
Alex Fidanov
Telerik team
answered on 16 May 2012, 08:05 AM
Hello Jyothsna,

 The PersistenceFramework is not persisting the bindings. It only saves and loads the local values of the controls. In your case, the PersistenceFramework would save the Background of the ColorPicker and then restore it. Are you using OneWay bindings? Please note, that with the one-way binding, when the source's local value is updated, the binding deactivates and the target stops updating. If this is the case, try using a two-way binding.

All the best,
Alex Fidanov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Jyothsna
Top achievements
Rank 1
answered on 16 May 2012, 09:19 AM
Thanks Alex for the quick reply.

So what can be the best approach in this scenario so that I can save the color settings.


0
Tina Stancheva
Telerik team
answered on 18 May 2012, 02:50 PM
Hi Jyothsna,

I attached a sample solution demonstrating how you can use a Two-Way binding along with the PersistenceFramework to implement your scenario. Please have a look at it and let me know if it works for you.

Greetings,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Jyothsna
Top achievements
Rank 1
answered on 22 May 2012, 06:25 AM
Thanks Tina,
This is what Iam looking for.
Tags
PersistenceFramework
Asked by
Jyothsna
Top achievements
Rank 1
Answers by
Jyothsna
Top achievements
Rank 1
Alex Fidanov
Telerik team
Tina Stancheva
Telerik team
Share this question
or