123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- 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("修改背景失败,已重置为默认背景!");
- }
- }
- }
- }
|