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
[ObservableProperty]
public int fontSize
// This method called whenever `fontSize` changes.
partial void OnFontSizeChanged(int value)
{
Preferences.Set("FontSize", value);
}
I get the MVVMTK0045 error
The field *.*.fontSize using [ObservableProperty] will generate code that is not AOT compatible...
and a partial property should be used instead
So I change the codes as suggested in the documentation to
[ObservableProperty]
public partial int FontSize { get; set }
// This method called whenever `fontSize` changes.
partial void OnFontSizeChanged(int value)
{
Preferences.Set("FontSize", value);
}
does not work and creates a different error "the partial property must have an implementation part". Any idea how to correct this issue?
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
-
Using the code below
I get the MVVMTK0045 error
So I change the codes as suggested in the documentation to
does not work and creates a different error "the partial property must have an implementation part". Any idea how to correct this issue?
Beta Was this translation helpful? Give feedback.
All reactions