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

PreviewClosed + ResponseButton = broken?

2 Answers 53 Views
Window
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 05 Jul 2011, 11:35 PM
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 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 05 Jul 2011, 11:40 PM
Apparently you can't attach zip files here nor delete your own forum posts. :(  I've opened a bug ticket instead.
0
Ivo
Telerik team
answered on 08 Jul 2011, 01:58 PM

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!

Tags
Window
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Ivo
Telerik team
Share this question
or