-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cecd907
commit 7ab73fd
Showing
2 changed files
with
78 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
using System.Collections.ObjectModel; | ||
using CommunityToolkit.Mvvm.ComponentModel; | ||
using System.Collections.ObjectModel; | ||
|
||
namespace MelonLoader.Installer.ViewModels; | ||
|
||
public class MainViewModel : ViewModelBase | ||
public partial class MainViewModel : ViewModelBase | ||
{ | ||
private static bool _ready; | ||
[ObservableProperty] | ||
private bool ready; | ||
|
||
public bool Ready | ||
{ | ||
get => _ready; | ||
set | ||
{ | ||
_ready = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
[ObservableProperty] | ||
private string? search; | ||
|
||
public ObservableCollection<GameModel> Games => GameManager.Games; | ||
[ObservableProperty] | ||
private ObservableCollection<GameModel> games = GameManager.Games; | ||
|
||
public string Version => Program.VersionName; | ||
partial void OnSearchChanged(string? value) | ||
{ | ||
Games = new(GameManager.Games.Where(x => string.IsNullOrEmpty(value) || x.Name.Contains(value, StringComparison.CurrentCultureIgnoreCase))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters