Exemple #1
0
        void onAnyPanel_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue != null && (bool)e.NewValue == true)
            {
                this._mainWindowVM.IsAnyPanelShownNow = true;

                var blurEffect = new System.Windows.Media.Effects.BlurEffect()
                {
                    Radius = 1
                };
                this.mainGrid.Effect = blurEffect;

                blurEffect.BeginAnimation(System.Windows.Media.Effects.BlurEffect.RadiusProperty, new System.Windows.Media.Animation.DoubleAnimation(8.0, TimeSpan.FromMilliseconds(100)));

                this.mainGridOverlayBorder.Opacity    = 0;
                this.mainGridOverlayBorder.Visibility = Visibility.Visible;
                this.mainGridOverlayBorder.BeginAnimation(UIElement.OpacityProperty, new System.Windows.Media.Animation.DoubleAnimation(0.1, TimeSpan.FromMilliseconds(100)));
            }

            if (e.NewValue != null && (bool)e.NewValue == false)
            {
                // the 'SettingsPanel' can also close itself; we need to cancel our blurring effects also in that case
                this.mainGridOverlayBorder.Visibility = Visibility.Collapsed;
                this.mainGrid.Effect = null;

                this._mainWindowVM.IsAnyPanelShownNow = false;

                // automatically do a 'Refresh': user might have changed the UserGUID in the settings panel
                this._mainWindowVM.JumpToYearMonthCommand.Execute(null);

                // switching between Month-based and CurrentDay-based DeskBand text
                ensureDeskBandInfoFormatterCreated();
            }
        }