SetProperty
is a protected method on the ObservableObject
class.
I notice in your file that you're missing an Import CommunityToolkit.Mvvm.ComponentModel
statement. The ObservableObject
type is defined there. Without that import then the compiler cannot figure out your base type and hence SetProperty
isn't available. That is the root of your issue I believe. You're seeing a cascading compiler error.
If the editor is showing ObservableObject
as being defined then it isn't coming from the toolkit and that is causing the problem instead. Right click the type and go to definition. You should end up in the toolkit metadata. If you end up elsewhere then you have multiple types with the same name.