CustomIconUrlDialog.xaml.cs 1.1 KB

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