View Model Property Dependency
Introduction
Code Example: Using DependsOn
class PlayerViewModel : ViewModel
{
public int Money
{
get => Get<int>();
set => Set(value);
}
[DependsOn(nameof(Money))]
public bool IsBrokeTextVisible => Money <= 0;
[DependsOn(nameof(Money))]
public string MoneyDisplay => $"${Money:N0}";
}
Last updated
Was this helpful?

