C# 5 PropertyChanged - No more magic strings!(www.robfe.com)

submitted by dpetersondpeterson(4397) 8 months, 3 days ago

Changes in C# 5 mean no more NotifyPropertyChanged("SomeVariable"), which is a common source of bugs. It also means we no longer have to suffer the performance degradation associated with using workarounds such as lambda's just for the sake of compile-time checking. From here on out, the compiler does the work for us.

2 comments |category: |Views: 588

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by vijaystvijayst(1311) 8 months, 3 days ago 0

So far the automatic code snippet generation has improved the productivity while defining properties. This feature will definitely help making the code cleaner.

Reply

posted by dpetersondpeterson(4397) replied to vijaystvijayst(1311), 8 months, 3 days ago 0

I use the lambda approach for compile-time checking: NotifyOfPropertyChange(() => SomeVariable)
It adds some line noise, and also reduces performance slightly. I'm looking forward to not having to do that.

Reply

information Login or create an account to comment on this story