Files
GeekDesk/Control/Other/CustomIconUrlDialog.xaml.cs

54 lines
1.4 KiB
C#
Raw Normal View History

2021-07-13 15:24:05 +08:00
using GeekDesk.Control.Windows;
using GeekDesk.Util;
2021-07-12 17:28:57 +08:00
using GeekDesk.ViewModel;
using Microsoft.Win32;
using System;
2022-01-06 17:45:25 +08:00
using System.Configuration;
using System.Diagnostics;
2021-07-12 17:28:57 +08:00
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
namespace GeekDesk.Control.Other
{
/// <summary>
/// TextDialog.xaml 的交互逻辑
/// </summary>
public partial class CustomIconUrlDialog
{
public CustomIconUrlDialog(AppConfig appConfig)
{
InitializeComponent();
2021-07-13 15:24:05 +08:00
this.DataContext = appConfig;
2021-07-12 17:28:57 +08:00
}
public CustomIconUrlDialog()
{
InitializeComponent();
}
2021-07-13 15:24:05 +08:00
private void Confirm_Click(object sender, RoutedEventArgs e)
{
AppConfig appConfig = this.DataContext as AppConfig;
appConfig.CustomIconJsonUrl = JsonUrl.Text.Trim();
appConfig.CustomIconUrl = IconUrl.Text.Trim();
if (!StringUtil.IsEmpty(IconUrl.Text) && !StringUtil.IsEmpty(JsonUrl.Text))
{
IconfontWindow.vm.IsSettingUrl = "true";
} else
{
IconfontWindow.vm.IsSettingUrl = "false";
}
}
2022-01-06 17:45:25 +08:00
private void Teach_Click(object sender, RoutedEventArgs e)
{
string url = ConfigurationManager.AppSettings["CustomIconTeachUrl"];
Process.Start(url);
}
2021-07-12 17:28:57 +08:00
}
}