Commit 08f77649 authored by Francesco Carraro's avatar Francesco Carraro
Browse files

a lot of fixes and refactoring for right-column usercontrols

parent 04935b4a
Loading
Loading
Loading
Loading
+23 −8
Original line number Diff line number Diff line
@@ -50,14 +50,15 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts

        /* contains value read from settings, when user navigate to the chart page, if value is true, then apply the value to 
         * the IsPinRequested and IsPinned variables, to enable the pinned version of flyout */
        public bool isPinnedPending { get; private set; }
        public bool IsPinnedPending { get; private set; }

        private bool isPinned;
        public bool IsPinned
        {
            get { return isPinned; }
            set { isPinned = value; RaisePropertyChanged(nameof(IsPinned)); saveIsPinned(value); }
        }
        //private bool isPinned;
        //public bool IsPinned
        //{
        //    get { return isPinned; }
        //    set { isPinned = value; RaisePropertyChanged(nameof(IsPinned)); saveIsPinned(value); }
        //}
        public bool IsPinned { get; set; }

        private bool isPinRequested;
        public bool IsPinRequested
@@ -83,6 +84,20 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts
        public ObservableCollection<WavelengthModel> WavelengthSeparators { get; private set; }
        #endregion

        #region pin/unpin
        public void raiseIsPinRequested()
        {
            IsPinRequested = true;
            isPinRequested = false;
        }

        public void raiseIsUnpinRequested()
        {
            IsUnpinRequested = true;
            isUnpinRequested = false;
        }
        #endregion

        #region save/read settings
        private void saveAreSeparatorsVisible(bool areVisible)
        {
@@ -125,7 +140,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts
            string value = settingsHelper.get(Constants.Constants.IS_ALIGNMENT_FLYOUT_PINNED);
            if (!string.IsNullOrEmpty(value))
            {
                isPinnedPending = value.ToBool();
                IsPinnedPending = value.ToBool();
                isFound = true;
            }

+7 −0
Original line number Diff line number Diff line
@@ -267,6 +267,9 @@
    <Compile Include="Views\UserControls\AlignmentConfigUserControl.xaml.cs">
      <DependentUpon>AlignmentConfigUserControl.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\UserControls\ChartVisualizationOptionsUserControl.xaml.cs">
      <DependentUpon>ChartVisualizationOptionsUserControl.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\UserControls\DeleteQuestionUserControl.xaml.cs">
      <DependentUpon>DeleteQuestionUserControl.xaml</DependentUpon>
    </Compile>
@@ -353,6 +356,10 @@
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\UserControls\ChartVisualizationOptionsUserControl.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
    </Page>
    <Page Include="Views\UserControls\DeleteQuestionUserControl.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
+6 −0
Original line number Diff line number Diff line
@@ -651,4 +651,10 @@
  <data name="ZoomTeachingTipMessage3.Text" xml:space="preserve">
    <value>Use numeric controls at the bottom to set the amount of shift of the zoomed region along x and y axes</value>
  </data>
  <data name="RawSpectrumAlignmentOpenPanel.Text" xml:space="preserve">
    <value>Open alignment settings panel</value>
  </data>
  <data name="RawSpectrumAlignmentButtonHidePanel.Text" xml:space="preserve">
    <value>Close alignment settings panel</value>
  </data>
</root>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -541,7 +541,7 @@

        <ResourceDictionary x:Key="Default">
            <SolidColorBrush x:Key="myTextForeground" Color="White" />
            <SolidColorBrush x:Key="myLogBorderBrush" Color="Black" />
            <SolidColorBrush x:Key="myTextBackground" Color="Black" />
            <SolidColorBrush x:Key="myTransparentBackground" Color="#77000000" />
            <SolidColorBrush x:Key="myBorder" Color="White" />

+31 −14
Original line number Diff line number Diff line
@@ -58,18 +58,25 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
            set { SetProperty(ref isLegendItemTapped, value); }
        }

        private bool isZoomUserControlShown;
        public bool IsZoomUserControlShown
        private bool isZoomUserControlCloseRequired;
        public bool IsZoomUserControlCloseRequired
        {
            get { return isZoomUserControlShown; }
            set { SetProperty(ref isZoomUserControlShown, value); }
            get { return isZoomUserControlCloseRequired; }
            set { SetProperty(ref isZoomUserControlCloseRequired, value); }
        }

        private bool isZoomUserControlShowRequired;
        public bool IsZoomUserControlShowRequired
        private bool isZoomUserControlOpen;
        public bool IsZoomUserControlOpen
        {
            get { return isZoomUserControlShowRequired; }
            set { SetProperty(ref isZoomUserControlShowRequired, value); }
            get { return isZoomUserControlOpen; }
            set { SetProperty(ref isZoomUserControlOpen, value); }
        }

        private bool isZoomUserControlOpenRequired;
        public bool IsZoomUserControlOpenRequired
        {
            get { return isZoomUserControlOpenRequired; }
            set { SetProperty(ref isZoomUserControlOpenRequired, value); }
        }

        private PointModel zoomCenter;
@@ -112,6 +119,18 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
            isLegendItemTapped = false;
        }

        protected void raiseIsZoomUserControlCloseRequired()
        {
            IsZoomUserControlCloseRequired = true;
            isZoomUserControlCloseRequired = false;
        }

        protected void raiseIsZoomUserControlOpenRequired()
        {
            IsZoomUserControlOpenRequired = true;
            isZoomUserControlOpenRequired = false;
        }

        protected virtual void removeFit(LegendItemExtension legendItem)
        {
            throw new NotImplementedException();
@@ -303,11 +322,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
                                                           ZoomCenter.Y - halfZoomRegionYLength,
                                                           zoomCenter.Y + halfZoomRegionYLength);
        }

        private void setZoomSettingsPanelVisibility(bool isVisible)
        {
            IsZoomUserControlShowRequired = isVisible;
        }
        #endregion
        #endregion

@@ -316,6 +330,9 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        public RelayCommand<LegendItemExtension> CommandChartItemTapped => commandChartItemTapped ?? (commandChartItemTapped = new RelayCommand<LegendItemExtension>((item) => selectChartItem(item)));

        #region zoom
        private RelayCommand commandCloseZoomSettingsPanel;
        public RelayCommand CommandCloseZoomSettingsPanel => commandCloseZoomSettingsPanel ?? (commandCloseZoomSettingsPanel = new RelayCommand(() => raiseIsZoomUserControlCloseRequired()));

        private RelayCommand commandEnableZoom;
        public RelayCommand CommandEnableZoom => commandEnableZoom ?? (commandEnableZoom = new RelayCommand(() => enableZoom()));

@@ -335,7 +352,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        public RelayCommand CommandNavigateZoomUp => commandNavigateZoomUp ?? (commandNavigateZoomUp = new RelayCommand(() => navigateZoomUp()));

        private RelayCommand commandOpenZoomSettingsPanel;
        public RelayCommand CommandOpenZoomSettingsPanel => commandOpenZoomSettingsPanel ?? (commandOpenZoomSettingsPanel = new RelayCommand(() => setZoomSettingsPanelVisibility(true)));
        public RelayCommand CommandOpenZoomSettingsPanel => commandOpenZoomSettingsPanel ?? (commandOpenZoomSettingsPanel = new RelayCommand(() => raiseIsZoomUserControlOpenRequired()));
        #endregion

        private RelayCommand<LegendItemExtension> commandRemoveFit;
Loading