diff --git a/App.xaml.cs b/App.xaml.cs index eed2eac..c136f39 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -11,6 +11,9 @@ using HeBianGu.Systems.Identity; using HeBianGu.Systems.Setting; using Hopetry.Services; using SystemSetting = FileUploader.Models.SystemSetting; +using System.Configuration; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel; namespace HeBianGu.App.Disk { @@ -132,6 +135,9 @@ namespace HeBianGu.App.Disk protected override void Configure(IApplicationBuilder app) { base.Configure(app); + app.UseSetting(x => { + x.Settings.Add(MySetting.Instance); + }); app.UseStyle(); //app.UseSettingDefault(); // Do:设置默认主题 @@ -154,4 +160,20 @@ namespace HeBianGu.App.Disk }); } } + [Displayer(Name = "关机设置", GroupName = "是否关机")] + public class MySetting:LazySettingInstance + { + private bool _ison; + [DefaultValue(false)] + [Display(Name = "是否上传完成关机")] + public bool IsOn + { + get { return _ison; } + set + { + _ison = value; + RaisePropertyChanged("IsOn"); + } + } + } } \ No newline at end of file diff --git a/ViewModel/Loyout/LoyoutViewModel.cs b/ViewModel/Loyout/LoyoutViewModel.cs index 9850d7d..76b3298 100644 --- a/ViewModel/Loyout/LoyoutViewModel.cs +++ b/ViewModel/Loyout/LoyoutViewModel.cs @@ -176,7 +176,10 @@ namespace HeBianGu.App.Disk //更新总进度100% _sendViewModel.Progress = 100; // 关机 - Shutdown(); + if (MySetting.Instance.IsOn) + { + Shutdown(); + } // 停止计时器 timer.Stop(); }