Skip to content

Commit

Permalink
Improve signature of PlayListViewModel constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
bburky committed Nov 3, 2021
1 parent b8d137c commit 165415d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Playlist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public override IEnumerable<SidebarItem> GetSidebarItems()
Opened = () => {
if (PlaylistViewModel == null)
{
PlaylistViewModel = new PlaylistViewModel(this);
PlaylistViewModel = new PlaylistViewModel(PlaylistGames, PlayniteApi);
PlaylistView = new PlaylistView(PlaylistViewModel);
}
return PlaylistView;
Expand Down
9 changes: 3 additions & 6 deletions PlaylistViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ namespace Playlist
{
public class PlaylistViewModel : ObservableObject
{
private readonly Playlist playlist;

private readonly IPlayniteAPI playniteApi;

public ObservableCollection<Game> PlaylistGames { get; set; }
Expand Down Expand Up @@ -49,11 +47,10 @@ public IEnumerable<KeyValuePair<CompletionStatus, RelayCommand<IEnumerable<objec
}
}

public PlaylistViewModel(Playlist playlist)
public PlaylistViewModel(ObservableCollection<Game> playlistGames, IPlayniteAPI playniteApi)
{
this.playlist = playlist;
PlaylistGames = playlist.PlaylistGames;
playniteApi = playlist.PlayniteApi;
PlaylistGames = playlistGames;
this.playniteApi = playniteApi;

NavigateBackCommand = new RelayCommand<object>((a) =>
{
Expand Down

0 comments on commit 165415d

Please sign in to comment.