DataContext lost on Layout Load

4 posts, 0 answers
  1. Mike
    Mike avatar
    28 posts
    Member since:
    Apr 2013

    Posted 25 Nov 2013 Link to this post

    As per a fix for the GridView losing the binding when moving panes around I have the DataContext set in the RadPane that the GridView control is in. However now I've implemented the Save/Load for the layout this binding, when declared in XAML is lost.

    It's not a huge issue, as after the load I set the datacontext in the code. However is this by design, or is there a bug in the load layout that loses this binding?

    Cheers, Mike...
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 28 Nov 2013 Link to this post

    Hi,

    The Save/Load layout functionality is designed to save the Docking Pane's position/size but the value of the bindings are not saved which is an expected behavior.

    You can take a look at this forum thread in which the topic is discussed in greater detail.

    Regards,
    Vladi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Mike
    Mike avatar
    28 posts
    Member since:
    Apr 2013

    Posted 06 Dec 2013 Link to this post

    I don't want to save/load the bindings on the panes, but as I have pretty much all of my bindings defined in XAML these get lost/removed when I load in the layout, which is not what I would have expected to happen.

    I've worked around this by defining them in the code behind, as I said, but if the non-saving of the bindings is expected behaviour I would also expect that the loading of the layouts wouldn't clear any bindings I have in XAML

    Thanks, Mike...
  5. George
    Admin
    George avatar
    1332 posts

    Posted 12 Dec 2013 Link to this post

    Hi Mike,

    Setting SerializationTag to the panes will ensure that the bindings won't be cleared. Can you give it a try and let me know if this helps? It if doesn't help, can you send us a sample project so we can test it on our side?

    I am glad to assist you further.

    Regards,
    George
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top