Tigraine
Daniel Hoelbling talks about programming

Useful Resharper Live Template for WPF development

April 29th, 2010 . by Daniel Hölbling

While doing some work in WPF for a customer project I found myself writing far too often code like this:

private bool isSelected;

public bool IsSelected
{
    get { return isSelected; }
    set
    {
        isSelected = value;
        OnPropertyChanged("IsSelected");
    }
}

Auto-properties simply don’t work with INotifyPropertyChanged so you have to do all the grunt work over again .. Thank god there is Resharper!

It’s said lazyness is a virtue on a programmer, so I made this little Live Template that will create all that code with you only having to fill in type and name of your property:

image

Download it here: wpfprop.xml


  • ChrisJOwen

    Alternatively you could use an AOP framework like PostSharp, see here: http://doc.sharpcrafters.com/postsharp/2.0/##Po…

  • http://www.tigraine.at Daniel Hölbling

    Thanks for the tip.. I'll look into that :)

  • http://www.moncler-down-jackets.com nike air force shoes

    The post of content is very interesting and exciting. I learned a lot from here.The content from simple to complex, air jordan 8 so all of you can come in .ugg boots for sale No matter you want to see what can be found.By the way ,there are some websites is also very wonderful,you can go and see.such asair force 1 shoes