INotifyPropertyChanged - Événement reste nulle

Je suis en train de mettre en place des INotifyPropertyChanged Extension:

Automatiquement INotifyPropertyChanged (répondre)
http://ingebrigtsen.info/2008/12/11/inotifypropertychanged-revisited/

Mais je ne peux pas comprendre pourquoi mon PropertyChanged EventHandler reste nulle. 🙁

J'ai fait très simple Application WPF faire un test, voici mon Code XAML:

<StackPanel Orientation="Vertical">
    <TextBox Text="{Binding Path=SelTabAccount.Test, UpdateSourceTrigger=PropertyChanged}"></TextBox>
    <TextBox Text="{Binding Path=SelTabAccount.TestRelated, UpdateSourceTrigger=PropertyChanged}"></TextBox>
</StackPanel>

Et mon code behind:

public partial class MainWindow : Window, INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;

    private TabAccount _selTabAccount;

    public TabAccount SelTabAccount
    {
        get { return _selTabAccount; }
        set
        {
            _selTabAccount = value;
            PropertyChanged.Notify(() => this.SelTabAccount);
        }
    }

    public MainWindow()
    {
        InitializeComponent();

        SelTabAccount = new TabAccount()
        {
            Test = "qwer",
            TestRelated = ""
        };
    }
}

public partial class TabAccount : INotifyPropertyChanged
{
    private string _test;

    public string Test
    {
        get { return _test; }
        set
        {
            _test = value;
            PropertyChanged.Notify(() => this.Test);
            PropertyChanged.Notify(() => this.TestRelated);
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;
}

public partial class TabAccount
{
    private string _testRelated;

    public string TestRelated
    {
        get
        {
            _testRelated = Test + "_Related";
            return _testRelated;
        }
        set
        {
            _testRelated = value;
            PropertyChanged.Notify(() => this.TestRelated);
        }
    }
}

Dans le code-behind, vous verrez une classe (ses partielle juste pour le test de dépistage aléatoire) avec 2 propriétés que doit aviser d'un changement de propriété, mais rien ne se passe.

La NotificationExtension est un copier-coller à partir des liens fournis en haut et en externe de la cs de fichier.

J'ai aussi essayé de faire de l'échantillon avec la "normale" INotifyPropertyChanged la mise en œuvre et cela fonctionne comme prévu, mais je ne peux pas y arriver avec cette extension de la classe.

Espère que vous pourrez m'aider à le comprendre.
Merci à l'avance.

OriginalL'auteur Rand Random | 2013-08-28