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. + }