tengo unas pocas cosas BaseClass:¿Hereda de una clase base que implementa INotifyPropertyChanged?
public class BaseViewModel : INotifyPropertyChanged
{
protected void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
y una otra clase:
public class SchemaDifferenceViewModel : BaseViewModel
{
private string firstSchemaToCompare;
public string FirstSchemaToCompare
{
get { return firstSchemaToCompare; }
set
{
firstSchemaToCompare = value;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("FirstSchemaToCompare"));
//StartCommand.RaiseCanExecuteChanged();
}
}
}
PropertyChanged está aquí (2Veces), rojo subrayado, que dice:
Error 1 The event BaseViewModel.PropertyChanged' can only appear on the left hand side of += or -= (except when used from within the type 'SchemaDifferenceFinder.ViewModel.BaseViewModel')
Lo que estoy haciendo mal? Sólo barría el PropertyChangedEvent a una nueva clase: BaseViewModel ..
Enlace movido de nuevo: http://george.softumus.com/inotifypropertychanged-and-magic-strings/ –