Test WPF Desktop App with Caliburn And RestSharp
This commit is contained in:
24
LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/GameViewModel.cs
Normal file
24
LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/GameViewModel.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using Caliburn.Micro;
|
||||
using LaDOSE.DesktopApp.Services;
|
||||
using LaDOSE.DTO;
|
||||
|
||||
namespace LaDOSE.DesktopApp.ViewModels
|
||||
{
|
||||
public class GameViewModel : Screen
|
||||
{
|
||||
private RestService RestService { get; set; }
|
||||
public GameViewModel(RestService restService)
|
||||
{
|
||||
this.RestService = restService;
|
||||
}
|
||||
|
||||
public void LoadGames()
|
||||
{
|
||||
this.Games = this.RestService.GetGames();
|
||||
NotifyOfPropertyChange("Games");
|
||||
}
|
||||
|
||||
public List<Game> Games { get; set; }
|
||||
}
|
||||
}
|
||||
18
LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/ShellViewModel.cs
Normal file
18
LaDOSE.Src/LaDOSE.DesktopApp/ViewModels/ShellViewModel.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Caliburn.Micro;
|
||||
using LaDOSE.DesktopApp.Services;
|
||||
|
||||
namespace LaDOSE.DesktopApp.ViewModels
|
||||
{
|
||||
public class ShellViewModel : Conductor<IScreen>.Collection.OneActive
|
||||
{
|
||||
|
||||
public void LoadEvent()
|
||||
{
|
||||
ActivateItem(new WordPressViewModel(IoC.Get<RestService>()));
|
||||
}
|
||||
public void LoadGames()
|
||||
{
|
||||
ActivateItem(new GameViewModel(IoC.Get<RestService>()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using Caliburn.Micro;
|
||||
using LaDOSE.DesktopApp.Services;
|
||||
using LaDOSE.DTO;
|
||||
|
||||
namespace LaDOSE.DesktopApp.ViewModels
|
||||
{
|
||||
public class WordPressViewModel : Screen
|
||||
{
|
||||
private RestService RestService { get; set; }
|
||||
public WordPressViewModel(RestService restService)
|
||||
{
|
||||
this.RestService = restService;
|
||||
}
|
||||
|
||||
public void LoadEvents()
|
||||
{
|
||||
this.Events = this.RestService.GetEvents();
|
||||
NotifyOfPropertyChange("Events");
|
||||
}
|
||||
|
||||
public List<WPEvent> Events { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user