C#C
C#3y ago
Mek

✅ Getting Button Command Parameter Avalonia

public HomeViewModel()
{
    IObservable<bool> selectionOk = this.WhenAnyValue(
      x => x.SelectedDifficulty,
      x => x != "Select One");

    Play = ReactiveCommand.Create(
        PlayGame,
        selectionOk);
}

public void PlayGame() { }
public ReactiveCommand<Unit, Unit> Play { get; }
I have 4 buttons on my home screen
<Button Command={Binding Play} CommandParameter="Something" />
when I click the button, how do I get the PlayGame() function to get access to that CommandParameter?
Was this page helpful?