Added the NewControl as a content replacement for the MainWindow.

This commit is contained in:
alphafetus committed 2023-10-09 14:56:06 -04:00
1 parent 8c7e1b917f
commit 0e5be04b02
31 files changed
+262 -153

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
using System;
using System.Reactive;
using PcgsInvUi.Models;
using ReactiveUI;
namespace PcgsInvUi.ViewModels;
public class EditViewModel : ViewModelBase
{
public Coin CurrentCoin { get; set; }
public ReactiveCommand<Unit, Unit> OkCommand { get; }
public EditViewModel(Coin coin)
{
CurrentCoin = coin;
var okEnabled = this.WhenAnyValue(
x => x.CurrentCoin.PcgsNumber,
x => x.CurrentCoin.Grade,
x => x.CurrentCoin.Quantity,
(id, grade, quantity) => (id != 0) &&
!string.IsNullOrWhiteSpace(grade) &&
(quantity != 0)
);
// Setup OkCommand - all Coin-related properties must be non-whitespace.
OkCommand = ReactiveCommand.Create(() => { });
}
}