CustomIconUrlDialog.xaml.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using GeekDesk.Control.Windows;
  2. using GeekDesk.Util;
  3. using GeekDesk.ViewModel;
  4. using Microsoft.Win32;
  5. using System;
  6. using System.Configuration;
  7. using System.Diagnostics;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Media.Imaging;
  11. namespace GeekDesk.Control.Other
  12. {
  13. /// <summary>
  14. /// TextDialog.xaml 的交互逻辑
  15. /// </summary>
  16. public partial class CustomIconUrlDialog
  17. {
  18. public CustomIconUrlDialog(AppConfig appConfig)
  19. {
  20. InitializeComponent();
  21. this.DataContext = appConfig;
  22. }
  23. public CustomIconUrlDialog()
  24. {
  25. InitializeComponent();
  26. }
  27. private void Confirm_Click(object sender, RoutedEventArgs e)
  28. {
  29. AppConfig appConfig = this.DataContext as AppConfig;
  30. appConfig.CustomIconJsonUrl = JsonUrl.Text.Trim();
  31. appConfig.CustomIconUrl = IconUrl.Text.Trim();
  32. if (!StringUtil.IsEmpty(IconUrl.Text) && !StringUtil.IsEmpty(JsonUrl.Text))
  33. {
  34. IconfontWindow.vm.IsSettingUrl = "true";
  35. }
  36. else
  37. {
  38. IconfontWindow.vm.IsSettingUrl = "false";
  39. }
  40. }
  41. private void Teach_Click(object sender, RoutedEventArgs e)
  42. {
  43. string url = ConfigurationManager.AppSettings["CustomIconTeachUrl"];
  44. Process.Start(url);
  45. }
  46. }
  47. }