56 lines
1.6 KiB
C#
56 lines
1.6 KiB
C#
using CapMachine.Core;
|
|
using CapMachine.Wpf.Services;
|
|
using Prism.Services.Dialogs;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace CapMachine.Wpf.ViewModels
|
|
{
|
|
public class SplashScreenViewModel : DialogViewModel
|
|
{
|
|
private readonly IApplicationContext applicationContext;
|
|
|
|
private string displayText;
|
|
|
|
public string DisplayText
|
|
{
|
|
get { return displayText; }
|
|
set { displayText = value; RaisePropertyChanged(); }
|
|
}
|
|
|
|
public SplashScreenViewModel(
|
|
IApplicationContext applicationContext
|
|
)
|
|
{
|
|
this.applicationContext = applicationContext;
|
|
|
|
}
|
|
|
|
public override async void OnDialogOpened(IDialogParameters parameters)
|
|
{
|
|
await SetBusyAsync(async () =>
|
|
{
|
|
await Task.Delay(2000);
|
|
|
|
//加载本地的缓存信息
|
|
DisplayText = "Initializing";
|
|
|
|
OnDialogClosed();
|
|
//OnDialogClosed(ButtonResult.OK);
|
|
|
|
////如果本地授权存在,直接进入系统首页
|
|
//if (accessTokenManager.IsUserLoggedIn && applicationContext.Configuration != null)
|
|
// OnDialogClosed();
|
|
//else if (applicationContext.Configuration != null)
|
|
// OnDialogClosed(ButtonResult.Ignore);
|
|
//else
|
|
// OnDialogClosed(ButtonResult.No);
|
|
});
|
|
}
|
|
}
|
|
}
|