From 1ac87c66ad33e94a159bfb1340d6997415e1efc1 Mon Sep 17 00:00:00 2001 From: Lisa Malenfant Date: Fri, 3 Nov 2023 15:20:53 -0700 Subject: [PATCH] Updated the version numbers and NuGet packages, updated the code to leverage the change in the VTS where RangeOfT implements IEnumerable --- Vts.Gui.Wpf.Test/Vts.Gui.Wpf.Test.csproj | 8 +-- .../ViewModel/Controls/RangeViewModel.cs | 49 ++++++++----------- Vts.Gui.Wpf/Vts.Gui.Wpf.csproj | 14 +++--- 3 files changed, 32 insertions(+), 39 deletions(-) diff --git a/Vts.Gui.Wpf.Test/Vts.Gui.Wpf.Test.csproj b/Vts.Gui.Wpf.Test/Vts.Gui.Wpf.Test.csproj index 757549d..34bdc16 100644 --- a/Vts.Gui.Wpf.Test/Vts.Gui.Wpf.Test.csproj +++ b/Vts.Gui.Wpf.Test/Vts.Gui.Wpf.Test.csproj @@ -7,11 +7,11 @@ - - - + + + - + diff --git a/Vts.Gui.Wpf/ViewModel/Controls/RangeViewModel.cs b/Vts.Gui.Wpf/ViewModel/Controls/RangeViewModel.cs index e8f0cf5..3399db7 100644 --- a/Vts.Gui.Wpf/ViewModel/Controls/RangeViewModel.cs +++ b/Vts.Gui.Wpf/ViewModel/Controls/RangeViewModel.cs @@ -25,12 +25,11 @@ public RangeViewModel(DoubleRange range, string units, IndependentVariableAxis a _enableNumber = enableNumber; _axisType = axisType; - // todo: does this do anything? (start, stop, number already directly modified) - _range.PropertyChanged += (s, a) => + _range.PropertyChanged += (_, _) => { - OnPropertyChanged("Start"); - OnPropertyChanged("Stop"); - OnPropertyChanged("Number"); + OnPropertyChanged(nameof(Start)); + OnPropertyChanged(nameof(Stop)); + OnPropertyChanged(nameof(Number)); }; } @@ -48,11 +47,11 @@ public RangeViewModel() : this(new DoubleRange(1.0, 6.0, 60), "mm", IndependentV /// public double Start { - get { return _range.Start; } + get => _range.Start; set { _range.Start = value; - OnPropertyChanged("Start"); + OnPropertyChanged(nameof(Start)); } } @@ -61,11 +60,11 @@ public double Start /// public double Stop { - get { return _range.Stop; } + get => _range.Stop; set { _range.Stop = value; - OnPropertyChanged("Stop"); + OnPropertyChanged(nameof(Stop)); } } @@ -74,63 +73,57 @@ public double Stop /// public int Number { - get { return _range.Count; } + get => _range.Count; set { _range.Count = value; - OnPropertyChanged("Number"); + OnPropertyChanged(nameof(Number)); } } public string Units { - get { return _units; } + get => _units; set { _units = value; - OnPropertyChanged("Units"); + OnPropertyChanged(nameof(Units)); } } public string Title { - get { return _title; } + get => _title; set { _title = value; - OnPropertyChanged("Title"); - OnPropertyChanged("ShowTitle"); + OnPropertyChanged(nameof(Title)); + OnPropertyChanged(nameof(ShowTitle)); } } public bool EnableNumber { - get { return _enableNumber; } + get => _enableNumber; set { _enableNumber = value; - OnPropertyChanged("EnableNumber"); + OnPropertyChanged(nameof(EnableNumber)); } } - public bool ShowTitle - { - get { return Title.Length > 0; } - } + public bool ShowTitle => Title.Length > 0; public IndependentVariableAxis AxisType { - get { return _axisType; } + get => _axisType; set { _axisType = value; - OnPropertyChanged("AxisType"); + OnPropertyChanged(nameof(AxisType)); } } - public IEnumerable Values - { - get { return _range.AsEnumerable(); } - } + public IEnumerable Values => _range; } } \ No newline at end of file diff --git a/Vts.Gui.Wpf/Vts.Gui.Wpf.csproj b/Vts.Gui.Wpf/Vts.Gui.Wpf.csproj index c22989d..50692d6 100644 --- a/Vts.Gui.Wpf/Vts.Gui.Wpf.csproj +++ b/Vts.Gui.Wpf/Vts.Gui.Wpf.csproj @@ -13,8 +13,8 @@ readme.md https://github.com/VirtualPhotonics/Vts.Gui.Wpf git - 4.1.0.0 - 4.1.0.0 + 4.2.0.0 + 4.2.0.0 AnyCPU Debug;Release;WhiteList True @@ -71,13 +71,13 @@ - - - - + + + + - +