-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Description
Hi,
i want to subscribe to the PorpertyChanged event of my ViewModel. But the generated Interface does not include the INotifyPropertyChanged interface. Because of this i always need to cast my ViewModel to subscribe to the event.
Example:
[ViewModelGenerateInterface]
[ViewModel]
public partial class MyClass
{
public void Foo() { }
}
leads to this generation:
partial class MyClass : global::MvvmGen.ViewModels.ViewModelBase, IMyClass
{
public MyClass()
{
this.OnInitialize();
}
partial void OnInitialize();
}
public interface IMyClass
{
void Foo();
}
would be nice if it does
public interface IMyClass : INotifyPropertyChanged
{
void Foo();
}
I could then do :
IMyClass myClass = new MyClass();
myClass.PropertyChanged += MyClass_PropertyChanged;
instead of:
IMyClass myClass = new MyClass();
if(myClass is INotifyPropertyChanged vm)
vm.PropertyChanged += MyClass_PropertyChanged;
thomasclaudiushuber
Metadata
Metadata
Assignees
Labels
No labels