app center

This commit is contained in:
Aigio Liu
2021-02-28 19:06:28 +08:00
parent 6ebfafb307
commit de914f7c71
4 changed files with 33 additions and 5 deletions
@@ -1,4 +1,9 @@
using System.Windows;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
using Microsoft.Extensions.Options;
using System.Application.Models;
using System.Windows;
using System.Windows.Shell;
using WpfApplication = System.Windows.Application;
@@ -16,5 +21,18 @@ namespace System.Application.UI
void JumpList_JumpItemsRemovedByUser(object sender, JumpItemsRemovedEventArgs e)
{
}
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var options = DI.Get_Nullable<IOptions<AppSettings>>();
var appSecret = options?.Value.AppSecretVisualStudioAppCenter;
if (!string.IsNullOrWhiteSpace(appSecret))
{
AppCenter.Start(appSecret, typeof(Analytics), typeof(Crashes));
}
}
}
}