CustomIconUrlDialog.xaml.cs 1.3 KB

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