Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fody Propertychanged on Viewmodels #332

Open
mos379 opened this issue Apr 13, 2022 · 0 comments
Open

Fody Propertychanged on Viewmodels #332

mos379 opened this issue Apr 13, 2022 · 0 comments

Comments

@mos379
Copy link

mos379 commented Apr 13, 2022

I'm struggling with using fody propertychanged on viewmodels.

I added the PropertyChangedNotificationInterceptor to the sample project and can see that it doesn't work there eiter.

namespace FreshMvvmApp
{
    internal class PropertyChangedNotificationInterceptor
    {
        public static void Intercept(object target, Action onPropertyChangedAction, string propertyName)
        {
#if DEBUG
            Console.WriteLine(@"[PROPERTYCHANGED] Target: " + target + @" Property: " + propertyName);
#endif
            onPropertyChangedAction();
        }
    }
}

it is working fine on classes like the contacts and prints out the debug info when loading the contacts collection (InitContacts () )
[PROPERTYCHANGED] Target: FreshMvvmApp.Contact Property: Id
[PROPERTYCHANGED] Target: FreshMvvmApp.Contact Property: Name
[PROPERTYCHANGED] Target: FreshMvvmApp.Contact Property: Phone

But what I'm missing is that this should be triggered as well on ViewModels if the actual contact is changed.
Should this be triggered as well when the contact is set on the ContactPageModel?

And yes I know I can use the WhenAny extension but that is working around Fody!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant