增加了初始弹窗,但是没有成功
更改了CAN和LIN协调 更改了配置程序的名称顺序
This commit is contained in:
55
CapMachine.Wpf/ViewModels/SplashScreenViewModel.cs
Normal file
55
CapMachine.Wpf/ViewModels/SplashScreenViewModel.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user