添加功能

This commit is contained in:
liufei
2021-05-26 17:19:04 +08:00
parent 8deff6c9d5
commit 569b330976
12 changed files with 253 additions and 65 deletions

View File

@@ -1,4 +1,6 @@
using GeekDesk.Util;
using GeekDesk.ViewModel;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -36,8 +38,30 @@ namespace GeekDesk.Control.UserControls
}
private void Button_Click(object sender, RoutedEventArgs e)
/// <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);
}
} catch (Exception)
{
HandyControl.Controls.Growl.WarningGlobal("修改背景失败,已重置为默认背景!");
}
}
}