From a8815b8f9ad4e53b2d0f5f75a00d354692eb2e09 Mon Sep 17 00:00:00 2001 From: lihanbo Date: Fri, 25 Oct 2024 15:17:32 +0800 Subject: [PATCH] =?UTF-8?q?105040=20=E4=BD=BF=E7=94=A8FormUISettings?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModel/MainViewModel.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs index e215582..0efa194 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/ViewModel/MainViewModel.cs @@ -1,5 +1,6 @@ using EPLAN.Harness.Common.Extensions; using EPLAN.Harness.Core.Controls; +using EPLAN.Harness.Core.Settings; using EPLAN.Harness.ProjectCore.Report; using Sinvo.EplanHpD.Plugin.WPFUI.Models; using Sinvo.EplanHpD.Plugin.WPFUI.Utils; @@ -134,6 +135,8 @@ public partial class MainViewModel : INotifyPropertyChanged { _flagType = value; OnPropertyChanged(nameof(FlagType)); + FormUISettings.Instance.SetValue("FlagType", $"{FlagType}"); + FormUISettings.Instance.SaveSingleton(); } } #endregion @@ -156,6 +159,15 @@ public partial class MainViewModel : INotifyPropertyChanged public Task> LoadReportDataAsync(IEnumerable data, List columns) { + var savedFlagType = FormUISettings.Instance.GetValue("FlagType"); + if (Enum.IsDefined(typeof(WireFlagType), savedFlagType)) + { + FlagType = (WireFlagType)Enum.Parse(typeof(WireFlagType), savedFlagType.ToString()); + } + else + { + FlagType = WireFlagType.Dual; + } var reportDatas = new ConcurrentBag(); //foreach (var entry in data) data.AsParallel().WithDegreeOfParallelism(8).ForAll(entry => @@ -382,6 +394,8 @@ public partial class MainViewModel : INotifyPropertyChanged private void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + //new StudioSettings().Plugins. + }