下班 还有一些小问题 1.0版本就可以发布了
This commit is contained in:
60
Control/UserControls/Config/ThemeControl.xaml.cs
Normal file
60
Control/UserControls/Config/ThemeControl.xaml.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace GeekDesk.Control.UserControls.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// MotionControl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ThemeControl : System.Windows.Controls.UserControl
|
||||
{
|
||||
public ThemeControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改背景图片
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void BGButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AppConfig appConfig = MainWindow.appData.AppConfig;
|
||||
|
||||
try
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog
|
||||
{
|
||||
Multiselect = false, //只允许选中单个文件
|
||||
Filter = "图像文件(*.png, *.jpg)|*.png;*.jpg;*.gif"
|
||||
};
|
||||
if (ofd.ShowDialog() == true)
|
||||
{
|
||||
appConfig.BitmapImage = ImageUtil.GetBitmapImageByFile(ofd.FileName);
|
||||
appConfig.BacImgName = ofd.FileName;
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
HandyControl.Controls.Growl.WarningGlobal("修改背景失败,已重置为默认背景!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user