using Notifications.Wpf; using System; using System.Threading.Tasks; using System.Windows; namespace DeviceCenter { /// /// Splash.xaml 的交互逻辑 /// public partial class Splash : Window { private NotificationManager notificationManager = new NotificationManager(); public Splash() { InitializeComponent(); //CarCamSDK.Net_Init(); //Login login = new Login(); //login.Show(); //Close(); init(); } private async void init() { await Task.Run(() => { int code = CarCamSDK.Net_Init(); notificationManager.Show(new NotificationContent { Title = "Info", Message = "CarCamSDK Net_Init " + code, Type = NotificationType.Information }); if (!CHCNetSDK.NET_DVR_Init()) { notificationManager.Show(new NotificationContent { Title = "Error", Message = "NET_DVR_Init Error", Type = NotificationType.Error }); } else { notificationManager.Show(new NotificationContent { Title = "Success", Message = "NET_DVR_Init Succss", Type = NotificationType.Success }); } Application.Current.Dispatcher.Invoke((Action)(() => { Login login = new Login(); login.Show(); Close(); })); }); } } }