Does Persistence framework persists bindings between the controls.

6 posts, 0 answers
  1. Jyothsna
    Jyothsna avatar
    4 posts
    Member since:
    May 2012

    Posted 16 May 2012 Link to this post

    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.
  2. Jyothsna
    Jyothsna avatar
    4 posts
    Member since:
    May 2012

    Posted 16 May 2012 Link to this post

    Hello Telerik ,

    Can you pls clarify the above issue. Iam using RadColorpicker .
  3. DevCraft banner
  4. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 16 May 2012 Link to this post

    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 >>

  5. Jyothsna
    Jyothsna avatar
    4 posts
    Member since:
    May 2012

    Posted 16 May 2012 Link to this post

    Thanks Alex for the quick reply.

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


  6. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 18 May 2012 Link to this post

    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 >>

  7. Jyothsna
    Jyothsna avatar
    4 posts
    Member since:
    May 2012

    Posted 22 May 2012 Link to this post

    Thanks Tina,
    This is what Iam looking for.
Back to Top
DevCraft banner