InformationCriminals.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections.ObjectModel;
  2. using System.Reactive;
  3. using ReactiveUI;
  4. namespace Avalonia.UI.ViewModels;
  5. public class InformationCriminals : ViewModelBase
  6. {
  7. private bool _isBusy;
  8. private string? _searchText;
  9. public string? SearchText
  10. {
  11. get => _searchText;
  12. set => this.RaiseAndSetIfChanged(ref _searchText, value);
  13. }
  14. public bool IsBusy
  15. {
  16. get => _isBusy;
  17. set => this.RaiseAndSetIfChanged(ref _isBusy, value);
  18. }
  19. private VID? _selectedVID;
  20. public ObservableCollection<VID> SearchResults { get; } = new();
  21. public VID? SelectedSomething
  22. {
  23. get => _selectedVID;
  24. set => this.RaiseAndSetIfChanged(ref _selectedVID, value);
  25. }
  26. public InformationCriminals()
  27. {
  28. SearchResults.Add(new VID());
  29. SearchResults.Add(new VID());
  30. SearchResults.Add(new VID());
  31. }
  32. public ReactiveCommand<Unit, VID?> BMCommand { get; }
  33. BMCommand = ReactiveCommand.Create(() =>
  34. {
  35. return SelectedAlbum;
  36. });
  37. }