Closed MattePozzy closed 5 months ago
Have you looked at https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/generators/observableproperty#notifying-dependent-properties ?
I think it is meant for situations like this.
Have you looked at https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/generators/observableproperty#notifying-dependent-properties ?
I think it is meant for situations like this.
Hi @DaveInCaz, thank you for your reply but unfortunately I have already looked at that link but could not apply it to my case.
I tried using NotifyPropertyChangedFor
but it still doesn't update the UI.
I'm not sure as to whether I oversee the obvious or misunderstand the problem, but here's two ways to react to changes to an Observable property in the MVVM toolkit:
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(OtherProperty))]
private bool originalProperty;
partial void OnOriginalPropertyChanged(bool value)
{
// do something ...
}
Hi, in a old XF application I have some properties declare like this one:
public bool SpeseWOButtonVisible { get { return SpeseWOVisible || BtutteSezioniChiuse; } }
How can I bring them into .MAUI and turn them into anObservableProperty
?I used this code
but when I update from the ViewModel
SpeseWOVisible
orBtutteSezioniChiuse
,SpeseWOButtonVisible
is not updated and consequently the UI does not update as well.How can I solve this?
Thank you.