Skip to main content

Microsoft Silverlight

Silverlight 2 Beta 1 - LostFocus and Data Binding BugsRSS Feed

(1)

karlshifflett
karlshif...

Member

Member

8 points

13 Posts

Silverlight 2 Beta 1 - LostFocus and Data Binding Bugs

Silverlight Team:  I have posted blog entry here :  http://karlshifflett.wordpress.com/2008/04/12/silverlight-2-lostfocus-and-data-binding-bugs/ that has two videos, source code and a short write up.

Here are the links to the same two videos on my blog.

Silverlight 2 LostFocus Bugs Video 

Silverlight 2 Data Binding Bugs Video 

LostFocus Bugs

The above video covers the LostFocus bugs in great detail. (please watch it)

  • Bug:  Wrong control reported in LostFocus RoutedEvent Source when event handler is declared in XAML or by using AddHandler control, delegate ( ex: AddHandler txtName.LostFocus, AddressOf TextBox_LostFocus ).
  • Works:  Correct control reported in LostFocus RoutedEvent Source when event handler is declare in code using the Handles syntax.  ( Ex: Handles txtName.LostFocus )
  • Bug:  Button control does not honor the IsTabStop property when set to False.  Button will still receive focus even though the Button property IsTabStop=False.
  • Works:  GotFocus RoutedEvent Source is correct regardless of where the event handler is set up.  Event handler can be set using Handles, Addhandler, XAML on the control or XAML in a parent container.

Data Binding Bugs

The above video covers the Data Binding bugs in great detail. (please watch it)

  • Bug:  First time the TextBoxes are tabbed through in a form and their values are not null, the INotifyPropertyChanged event is raised, even if no changes are made to the TextBox.  On the second and subsequent passes through the form, the event is not raised unless the property is actually changed by the user changing the TextBox.  This does not happen in WPF.
  • Bug:  TextBox controls are not updated even if a converter is used in the binding statement.  In WPF, if a converter is used in a binding statement, the convert is run after the data binding takes place and the UI is updated.  This does not happen in Silverlight but should.
  • Bug:  If a System.FormatException is thrown when the data binding pipeline attempts to set a property, the exception is caught (but never reported) and then the data binding pipeline sets the property to its default value.  This should not happen.  If a System.FormatException occurs, that should stop all further process and the exception should be reported like WPF. 

Thank you and have a great day!

Cheers,

Karl Shifflett
Microsoft Program Manager

Code Project MVP, Blog: Get Mole and XAML Power Toys here also!

Just a grain of sand on the worlds beaches.

Rob_Relyea
Rob_Relyea

Member

Member

40 points

5 Posts

Re: Silverlight 2 Beta 1 - LostFocus and Data Binding Bugs

Thanks for the great detail Karl!  Got this issue in front of the right people.

-Rob

Rob Relyea | WPF & Xaml Language Team
robrelyea.com | /blog | /wpf | /xaml

leaf_fan
leaf_fan

Member

Member

70 points

33 Posts

Re: Silverlight 2 Beta 1 - LostFocus and Data Binding Bugs

 

May I ask, what is the status of these issues?

I have a very simple condition where two textboxes are binding to the same property (yes with TwoWay) yet when one is updated, after lostfocus the other is not notified (yes the entity implements INotify).  I am seeing even greater issues when binding the same entity value across multiple user controls... they don't talk back... I am having to handle the propertychanged events manually to update controls... are these known issues?

karlshifflett
karlshif...

Member

Member

8 points

13 Posts

Re: Silverlight 2 Beta 1 - LostFocus and Data Binding Bugs

Are you on Beta 2 yet?  If not, start using this.

I have seen some strange things in Beta 2 also.  I noticed that the LostFocus event fires once for the control that looses focus and the next control in the the tab order.

I'm also having some binding update issues too.

I have not had time to send these to Microsoft yet but will after my move. 

I would look for the RTM release to have data binding all sorted out.

Cheers,

Karl Shifflett
Microsoft Program Manager

Code Project MVP, Blog: Get Mole and XAML Power Toys here also!

Just a grain of sand on the worlds beaches.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities