Add Avalonia based desktop client

Squashed commit of the following:

commit 0bfba90cd31bc9d401bf25cd479f6aef314988d5
Author: luxick <git@luxick.de>
Date:   Mon Mar 2 21:58:32 2020 +0100

    Add view switching with Global.Navigator

commit e0f535152aaa31fc2d4b6712459d208e27831696
Author: luxick <git@luxick.de>
Date:   Mon Mar 2 20:53:01 2020 +0100

    Make ViewModels require api client

commit f66c9148fdb1c34a2b92321dfc7a053894f381ce
Author: luxick <git@luxick.de>
Date:   Mon Mar 2 20:51:35 2020 +0100

    Update framework to core 3.1

commit 273b2940f043d889c70e8d7a69a54d6b4b200a62
Author: luxick <git@luxick.de>
Date:   Mon Mar 2 20:49:43 2020 +0100

    Player and Season View/Models

commit b3325b176740c403381009882c98a401ece05d0a
Author: luxick <git@luxick.de>
Date:   Mon Mar 2 20:44:55 2020 +0100

    Add EstusShots.Avalonia project
This commit is contained in:
2020-03-02 22:02:19 +01:00
parent 3e72acf71a
commit 687c3ffbfa
21 changed files with 702 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using System;
using ReactiveUI;
namespace EstusShots.Avalonia.ViewModels
{
public class MainWindowViewModel : ViewModelBase
{
public IServiceProvider Container;
private ViewModelBase _content;
public MainWindowViewModel(IServiceProvider container)
{
Container = container;
}
public ViewModelBase Content
{
get => _content;
set => this.RaiseAndSetIfChanged(ref _content, value);
}
}
}

View File

@@ -0,0 +1,14 @@
using EstusShots.Client;
namespace EstusShots.Avalonia.ViewModels
{
public class PlayersViewModel : ViewModelBase
{
private readonly EstusShotsClient _apiClient;
public PlayersViewModel(EstusShotsClient apiClient)
{
_apiClient = apiClient;
}
}
}

View File

@@ -0,0 +1,26 @@
using System.Collections.Generic;
using System.Reactive;
using EstusShots.Client;
using EstusShots.Shared.Dto;
using ReactiveUI;
namespace EstusShots.Avalonia.ViewModels
{
public class SeasonsViewModel : ViewModelBase
{
private readonly EstusShotsClient _apiClient;
private readonly MainWindowViewModel _main;
public List<Season> Seasons { get; set; }
public ReactiveCommand<Unit, Unit> ToPlayers { get; }
public SeasonsViewModel(EstusShotsClient apiClient, MainWindowViewModel main)
{
_apiClient = apiClient;
_main = main;
ToPlayers = ReactiveCommand.Create(() => { Global.Navigator.GoTo<PlayersViewModel>(); });
}
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
using ReactiveUI;
namespace EstusShots.Avalonia.ViewModels
{
public class ViewModelBase : ReactiveObject
{
}
}