App.Xaml.Mvx.cs.pp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Windows;
  3. using Cirrious.CrossCore;
  4. using Cirrious.MvvmCross.ViewModels;
  5. using Cirrious.MvvmCross.Wpf.Views;
  6. namespace $rootnamespace$
  7. {
  8. public partial class App : Application
  9. {
  10. private bool _setupComplete;
  11. private void DoSetup()
  12. {
  13. LoadMvxAssemblyResources();
  14. var presenter = new MvxSimpleWpfViewPresenter(MainWindow);
  15. var setup = new Setup(Dispatcher, presenter);
  16. setup.Initialize();
  17. var start = Mvx.Resolve<IMvxAppStart>();
  18. start.Start();
  19. _setupComplete = true;
  20. }
  21. protected override void OnActivated(EventArgs e)
  22. {
  23. if (!_setupComplete)
  24. DoSetup();
  25. base.OnActivated(e);
  26. }
  27. private void LoadMvxAssemblyResources()
  28. {
  29. for (var i = 0;; i++)
  30. {
  31. string key = "MvxAssemblyImport" + i;
  32. var data = TryFindResource(key);
  33. if (data == null)
  34. return;
  35. }
  36. }
  37. }
  38. }