Oct 26 2009

Note to self

Category: fossmo @ 13:17

Remember to use a property when data binding in Windows Presentation Foundation. If you don’t remember this, you will spend at least one hour scratching your head wondering why the data won’t show up in your list box and swearing at Visual Studio 2010. But, it’s not studios fault, it’s yours!

This is wrong (field):

public List<string> MyProperty;

This is correct (property):

private List<string> _myProperty;
public List<string> MyProperty 
{ 
   get { return _myProperty; } 
   set { _myProperty = value; } 
}

I will never do this again!

Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Comments are closed