• Code
  • Tags
  • Users
  • Titles
  • Log in
  • Feedback
  • FAQ
Share Code
Welcome to ForkCan.com

ForkCan is all about sharing code in a social way.

Discuss, debate or argue with other devs about their or your own code.

Give other devs feedback or make a Fork (Make a better version of a shared code).

Rate the code, if you use the code mark it as used so others can see if the shared code is used by someone.

Help each other to be better devs and to be more productive.


Features not working yet:

Flag a post


QR Code

Tiny Url

https://www.4kcan.com/s/NDI2

Related Code
Strongly typed NotifyPropertyChanged
Silverlight RelayCommand to simplify using the ICommand interface
Execute.OnUIThread & Execute.InBackground utility methods
IsInDesignMode for WPF and Silverlight
Default command implementation for Silverlight

Fork of Strongly typed NotifyPropertyChanged

Strongly typed NotifyPropertyChanged using Reflection

0
1.62k 0 0 0 0 1

While my version is not as pretty when used, The implementation of it is much shorter.

public class PropertyChangedBase : INotifyPropertyChanged
{
    private string GetName<T>(T item) where T : class
    {
        var properties = typeof(T).GetProperties();
        return properties[0].Name;
    }
}

Usage:

public class SomeViewModel : PropertyChangedBase
{
    string name;

    public string Name
    {
        get { return name; }
        set
        {
            name = value;
            NotifyOfPropertyChange(GetName(new {Name}));
        }
    }
}

Share: twitter | facebook   Action: used | fork | flag

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

silverlight

Mark 'silverlight' tag as 'like'

Mark 'silverlight' tag as 'ignore'

wpf

Mark 'wpf' tag as 'like'

Mark 'wpf' tag as 'ignore'


 @adam.lith "I'm a Forker"
400
January 03, 2011 1:28 PM
edited January 03, 2011 1:31 PM

Fork

 Strongly typed NotifyPropertyChanged -  @torkelo Tuesday 13, 2010 2:44 PM
 Fork of Strongly typed NotifyPropertyChanged -  @adam.lith Monday 03, 2011 1:28 PM


0 Feedback


You must log in before you can give any feedback


1 Discussion(s)

Newest Oldest
0

I think this stack-exchange proposal might be of interest to you. If it is show your support and help get it into beta :)

link | flag  | Reply

 greatwolf
22
Sunday 16, 2011 9:37 AM


You must log in before you can post a comment

Squeed
Made by: Fredrik Normén 2010