This repository has been archived by the owner on Jun 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.xaml.cs
47 lines (40 loc) · 1.53 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using AvansApp.Services;
namespace AvansApp
{
sealed partial class App : Application
{
private Lazy<ActivationService> _activationService;
private ActivationService ActivationService { get { return _activationService.Value; } }
public App()
{
InitializeComponent();
_activationService = new Lazy<ActivationService>(CreateActivationService);
}
protected override async void OnLaunched(LaunchActivatedEventArgs e)
{
if (!e.PrelaunchActivated)
{
await ActivationService.ActivateAsync(e);
}
}
protected override async void OnActivated(IActivatedEventArgs args)
{
await ActivationService.ActivateAsync(args);
}
protected override async void OnBackgroundActivated(BackgroundActivatedEventArgs args)
{
await ActivationService.ActivateAsync(args);
}
private ActivationService CreateActivationService()
{
/*if (Models.OAuth.GetInstance().Client.IsLoggedIn())
return new ActivationService(this, typeof(ViewModels.Pages.SchedulePageViewModel), new Views.MainPage());
else
return new ActivationService(this, typeof(ViewModels.Pages.LoginPageViewModel), new Views.MainPage());*/
return new ActivationService(this, typeof(ViewModels.Pages.SplashPageViewModel));
}
}
}