Pushing currently broken code.

This commit is contained in:
alphafetus committed 2023-11-29 21:29:47 -05:00
1 parent 435d01ef90
commit 4b2504b48c
10 files changed
+108 -36

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
using ReactiveUI;
using System.Reactive;
namespace PcgsInvUi.ViewModels;
public class ApiKeyViewModel : ViewModelBase {
public string ApiKeyInput {
get => _apiKeyInput;
set => this.RaiseAndSetIfChanged(ref _apiKeyInput, value);
}
private string _apiKeyInput = "";
public bool OkEnabled {
get => _okEnabled;
set => this.RaiseAndSetIfChanged(ref _okEnabled, value);
}
private bool _okEnabled;
public ReactiveCommand<Unit, string> OkCommand { get; }
public ApiKeyViewModel() {
var okEnabled = this.WhenAnyValue(
x => x.ApiKeyInput,
x => !string.IsNullOrWhiteSpace(x));
// Get the API key from the user.
OkCommand = ReactiveCommand.Create(() => ApiKeyInput, okEnabled);
}
}