You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My view models subclass a base view model so I cannot derive from ObservableObject. So now I think I have to do something like this:
public class MyViewModel : BaseViewModel
{
public MyViewModelData Data = new();
public void CallMe() {}
}
public partial class MyViewModelData : ObservableObject
{
[ObservableProperty]
private int myInt;
partial void OnMyIntChanged(int value)
{
// How to call CallMe
}
}
Is it possible to bypass the MyViewModelData class and have MyInt property in MyViewModel. Then it's also easier to call other methods in MyViewModel.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My view models subclass a base view model so I cannot derive from
ObservableObject
. So now I think I have to do something like this:Is it possible to bypass the
MyViewModelData
class and haveMyInt
property inMyViewModel
. Then it's also easier to call other methods inMyViewModel
.Beta Was this translation helpful? Give feedback.
All reactions