PreviewClosed + ResponseButton = broken?

3 posts, 0 answers
  1. Michael
    Michael avatar
    24 posts
    Member since:
    Sep 2010

    Posted 05 Jul 2011 Link to this post

    It looks like the response button implementation is not quite right in Silverlight: it's not updating the bindings before the PreviewClosed event is fired, but does update them before the Closed event is fired.  The WPF version of RadWindow works as expected.  See the attached solution which contains Silverlight code cross linked to a WPF project; output goes to the Output window via Debug.Writeline().
  2. Michael
    Michael avatar
    24 posts
    Member since:
    Sep 2010

    Posted 05 Jul 2011 Link to this post

    Apparently you can't attach zip files here nor delete your own forum posts. :(  I've opened a bug ticket instead.
  3. DevCraft banner
  4. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 08 Jul 2011 Link to this post

    Hello Michael,

    Thank you for your interest in RadWindow.

    In Silverlight, the TwoWay binding to the Text property of TextBox works differently. A change to the target updates the source when the TextBox loses its focus. Also there is a difference in the Silverlight and WPF focusing systems. The RadWindow moves the focus in the same way, but Silverlight moves the focus asynchronously and WPF moves it synchronously.

    However, you can easily achieve what you want by modifying your code a little:

    Adding the code below in OnViewPreviewClosed will update the target immediately:

    BindingExpression bindingExpression = 
        view.txtUsername.GetBindingExpression(TextBox.TextProperty);
    bindingExpression.UpdateSource();

    I have attached an example. Hope this helps. 

    All the best,
    Ivo
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top