App.xaml.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Configuration;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using PDF_Office.Views;
  9. using Prism.DryIoc;
  10. using Prism.Ioc;
  11. namespace PDF_Office
  12. {
  13. /// <summary>
  14. /// App.xaml 的交互逻辑
  15. /// </summary>
  16. public partial class App : PrismApplication
  17. {
  18. public App()
  19. {
  20. #if !DEBUG
  21. //接入Appcenter后台数据检测
  22. string appkey = "b099dccc-1ca5-4ea1-a2fa-afd4a6e1f8bb"
  23. AppCenter.Start(appkey, typeof(Analytics), typeof(Crashes));
  24. var countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;//上传国家信息
  25. AppCenter.SetCountryCode(countryCode);
  26. #endif
  27. }
  28. /// <summary>
  29. /// 创建启动窗口
  30. /// </summary>
  31. /// <returns></returns>
  32. protected override Window CreateShell()
  33. {
  34. return Container.Resolve<MainWindow>();
  35. }
  36. protected override void RegisterTypes(IContainerRegistry containerRegistry)
  37. {
  38. //单例
  39. containerRegistry.RegisterForNavigation<HomeContent>();
  40. containerRegistry.RegisterForNavigation<ViewContent>();
  41. }
  42. }
  43. }