Commit 89ed5d02 authored by Francesco Carraro's avatar Francesco Carraro
Browse files

fixed chart resize when userControls are open/close;

parent b7f3fbb0
Loading
Loading
Loading
Loading
+2 −22
Original line number Diff line number Diff line
@@ -892,29 +892,9 @@ namespace INAF.Apps.Uwp.SLabDataManager.Views
            infoUserControlTranslateTransform.X = ViewModel.ScreenWidth;

            if (ViewModel.UserControlsHelper.isAnyUserControlExceptInfoUserControl())
            {
                /* resize when any user control is opened */
                if (e.NewSize.Width > e.PreviousSize.Width)
                {
                    AnimationsHelper.GetExpandWidthStoryboard(spectrumChart, ContentArea.ActualWidth - ViewModel.UserControlsHelper.getUserControlWidth()).Begin();
                }
                else
                {
                    AnimationsHelper.GetShrinkWidthStoryboard(spectrumChart, ContentArea.ActualWidth - ViewModel.UserControlsHelper.getUserControlWidth()).Begin();
                }
            }
                spectrumChart.Width = ContentArea.ActualWidth - ViewModel.UserControlsHelper.getUserControlWidth();
            else
            {
                /* resize when no user control is opened */
                if (e.NewSize.Width > e.PreviousSize.Width)
                {
                    AnimationsHelper.GetExpandWidthStoryboard(spectrumChart, ContentArea.ActualWidth).Begin();
                }
                else
                {
                    AnimationsHelper.GetShrinkWidthStoryboard(spectrumChart, ContentArea.ActualWidth).Begin();
                }
            }
                spectrumChart.Width = ContentArea.ActualWidth;
        }

        private void infobar_CloseButtonClick(Microsoft.UI.Xaml.Controls.InfoBar sender, object args)