You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RootView.xaml.cs 1.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
12345678910111213141516171819202122232425262728293031323334353637
  1. using Helper;
  2. using HKCardOUT.ViewModels;
  3. using System;
  4. using System.IO;
  5. using System.Linq;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Forms;
  9. using System.Windows.Media;
  10. namespace HKCardOUT.Views
  11. {
  12. public partial class RootView : HandyControl.Controls.Window
  13. {
  14. public RootView()
  15. {
  16. InitializeComponent();
  17. if (!StartEXE.IsExistKey("HKCardOUT"))
  18. {
  19. var Paths = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "HKCardOUT.exe");
  20. StartEXE.SelfRunning(true, "HKCardOUT", Paths);
  21. }
  22. //else if (StartEXE.IsExistKey("HKCardOUT"))
  23. //{
  24. // var Paths = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "HKCardOUT.exe");
  25. // StartEXE.SelfRunning(false, "HKCardOUT", Paths);
  26. //}
  27. this.Loaded += RootView_Loaded;
  28. }
  29. private void RootView_Loaded(object sender, RoutedEventArgs e)
  30. {
  31. (this.DataContext as RootViewModel).Main = this;
  32. HKControl.Main.GetInstance.Init();
  33. }
  34. }
  35. }