Commit aadcbcc4 authored by Francesco Carraro's avatar Francesco Carraro
Browse files

fixesfor usercontrols

parent 7a2f3db5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ namespace INAF.Apps.Uwp.SLabDataManager
                /* usercontrols viewmodels */
                .AddScoped<AlignmentViewModel>()
                .AddScoped<MeasurementInfoViewModel>()
                .AddScoped<SampleDataViewModel>()
                .AddScoped<InfoViewModel>()
                .AddSingleton<SegmentsFitViewModel>()
                .AddScoped<SmoothingViewModel>()
                .AddSingleton<UserControlsViewModelFactory>()
+1 −1
Original line number Diff line number Diff line
@@ -252,7 +252,7 @@
    <Compile Include="ViewModels\UserControlViewModels\BaseUserControlViewModel.cs" />
    <Compile Include="ViewModels\UserControlViewModels\IUserControlViewModel.cs" />
    <Compile Include="ViewModels\UserControlViewModels\MeasurementInfoViewModel.cs" />
    <Compile Include="ViewModels\UserControlViewModels\SampleDataViewModel.cs" />
    <Compile Include="ViewModels\UserControlViewModels\InfoViewModel.cs" />
    <Compile Include="ViewModels\UserControlViewModels\SegmentsFitViewModel.cs" />
    <Compile Include="ViewModels\UserControlViewModels\SmoothingViewModel.cs" />
    <Compile Include="ViewModels\UserControlViewModels\UserControlsViewModelFactory.cs" />
+23 −4
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ using INAF.Apps.Uwp.SLabDataManager.Models.Fit;
using INAF.Apps.Uwp.SLabDataManager.ViewModels.ContentDialogsViewModel;
using INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels;
using INAF.Apps.Uwp.SLabDataManager.Views;
using INAF.Apps.Uwp.SLabDataManager.Views.UserControls;
using INAF.Libraries.NetStandard.Math.Fit.Linear;
using INAF.Libraries.NetStandard.SLabCommonModels.Models.WebApp.Requests;
using INAF.Libraries.Uwp.Logging;
@@ -24,6 +25,7 @@ using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using static INAF.Libraries.NetStandard.SLabCommonModels.Enums.Enums;
using INAF.Libraries.NetStandard.Extensions;

namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
{
@@ -235,8 +237,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
            set { SetProperty(ref measurementInfoViewModel, value); }
        }

        private SampleDataViewModel sampleDataViewModel;
        public SampleDataViewModel SampleDataViewModel
        private InfoViewModel sampleDataViewModel;
        public InfoViewModel SampleDataViewModel
        {
            get { return sampleDataViewModel; }
            set { SetProperty(ref sampleDataViewModel, value); }
@@ -378,6 +380,25 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        #endregion

        #region delete spectra
        public void closeAllUserControlsProcedure()
        {
            /* hide panel for creating continuum */
            if (UserControlsHelper.containsUserControl(nameof(InfoUserControl).FirstCharToLowerCase()))
                UserControlsHelper.addUserControlToBeClosed(nameof(InfoUserControl).FirstCharToLowerCase());

            /* hide panel for creating continuum */
            if (UserControlsHelper.containsUserControl(nameof(AlignmentUserControl).FirstCharToLowerCase()))
                UserControlsHelper.addUserControlToBeClosed(nameof(AlignmentUserControl).FirstCharToLowerCase());

            /* hide panel for creating continuum */
            if (UserControlsHelper.containsUserControl(nameof(SegmentsFitUserControl).FirstCharToLowerCase()))
                UserControlsHelper.addUserControlToBeClosed(nameof(SegmentsFitUserControl).FirstCharToLowerCase());

            /* hide panel for creating continuum */
            if (UserControlsHelper.containsUserControl(nameof(SmoothingUserControl).FirstCharToLowerCase()))
                UserControlsHelper.addUserControlToBeClosed(nameof(SmoothingUserControl).FirstCharToLowerCase());
        }

        public async Task deleteProcessedSpectraProcedureAsync()
        {
            IsLoading = true;
@@ -419,8 +440,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
                        case SpectrumType.AlignedSmoothed:
                        case SpectrumType.ContinuumRemovedSmoothedBySegments:
                        case SpectrumType.ContinuumRemovedSmoothed:
                            deleteSpectrumOfTypeSmoothedProcedure();
                            break;
                        case SpectrumType.Continuum:
                            break;
                        case SpectrumType.ContinuumRemoved:
+0 −4
Original line number Diff line number Diff line
@@ -32,10 +32,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        {
            /* set toggleSwitch for adding points for fitting continuum to 'off' */
            SegmentsFitViewModel.IsAddingPointsForContinuumRemovalAllowed = false;

            /* hide panel for creating continuum */
            if (UserControlsHelper.containsUserControl(nameof(AlignmentUserControl).FirstCharToLowerCase()))
                UserControlsHelper.addUserControlToBeClosed(nameof(AlignmentUserControl).FirstCharToLowerCase());
        }

        private async Task executeSpectrumAlignmentAsync()
+0 −4
Original line number Diff line number Diff line
@@ -87,10 +87,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels

        private async Task deleteSpectrumOfTypeContinuumRemovedProcedureAsync(bool removeFitSettings = false)
        {
            /* hide panel for creating continuum */
            if (UserControlsHelper.containsUserControl(nameof(SegmentsFitUserControl).FirstCharToLowerCase()))
                UserControlsHelper.addUserControlToBeClosed(nameof(SegmentsFitUserControl).FirstCharToLowerCase());

            if (removeFitSettings)
            {
                /* remove all points and segments for creating continuum */
Loading