Ejemplo n.º 1
0
 /// <summary>
 /// When window got maximized while a movie is playing : collapse menu bar, header tab and let tabcontrol takes up all the place available.
 /// Rollback when window go back to normal.
 /// </summary>
 /// <param name="sender">Sender object</param>
 /// <param name="e">EventArgs</param>
 private void OnWindowStateChanged(object sender, WindowStateChangedEventArgs e)
 {
     if (e.IsMoviePlaying)
     {
         SearchBar.Visibility = Visibility.Collapsed;
         MenuBar.Visibility   = Visibility.Collapsed;
         Grid.SetRow(MainTabControl, 0);
         Grid.SetRowSpan(MainTabControl, 4);
         Grid.SetColumn(MainTabControl, 0);
         Grid.SetColumnSpan(MainTabControl, 3);
         var headerPanelScroll = MainTabControl.FindChild <ScrollViewer>("HeaderPanelScroll");
         headerPanelScroll.Visibility = Visibility.Collapsed;
     }
     else
     {
         SearchBar.Visibility = Visibility.Visible;
         MenuBar.Visibility   = Visibility.Visible;
         Grid.SetRow(MainTabControl, 1);
         Grid.SetRowSpan(MainTabControl, 3);
         Grid.SetColumn(MainTabControl, 1);
         Grid.SetColumnSpan(MainTabControl, 1);
         var headerPanelScroll = MainTabControl.FindChild <ScrollViewer>("HeaderPanelScroll");
         headerPanelScroll.Visibility = Visibility.Visible;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Fire when window state has changed
        /// </summary>
        /// <param name="e">Event args</param>
        private void OnWindowStateChanged(WindowStateChangedEventArgs e)
        {
            Logger.Debug(
                "Window state changed");

            var handler = WindowStateChanged;

            handler?.Invoke(this, e);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Windows the state changed. If state is Hidden then remove window from visual tree.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="WindowStateChangedEventArgs"/> instance containing the event data.</param>
 private void WindowStateChanged(object sender, WindowStateChangedEventArgs e)
 {
     if (e.NewWindowState == Infragistics.Controls.Interactions.WindowState.Hidden)
     {
         LayoutRoot.Children.Remove(_videoVindow);
         _videoVindow.MainWindow.WindowStateChanged -= WindowStateChanged;
         _videoVindow = null;
     }
 }
Ejemplo n.º 4
0
 private void OnWindowStateChanged(object sender, WindowStateChangedEventArgs e)
 {
     if (e.NewValue == WindowState.Minimized)
     {
         this.MinimizedWindowsCount++;
     }
     else if (e.OldValue == WindowState.Minimized)
     {
         this.MinimizedWindowsCount--;
     }
 }
Ejemplo n.º 5
0
        private static void OnWindowStateChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            var window = obj as MDIWindow;

            if (window != null)
            {
                window.PreviousWindowState = (WindowState)e.OldValue;

                var args = new WindowStateChangedEventArgs(WindowStateChangedEvent, (WindowState)e.OldValue, (WindowState)e.NewValue);
                window.RaiseEvent(args);
            }
        }
Ejemplo n.º 6
0
        private void Update(WindowStateChangedEventArgs eventArgs)
        {
            WindowStateValue newState;

            if (eventArgs.OpenReedSwitchState == AdapterSwitchState.Open)
            {
                newState = WindowStateValue.Open;
            }
            else if (eventArgs.TildReedSwitchState.HasValue && eventArgs.TildReedSwitchState.Value == AdapterSwitchState.Open)
            {
                newState = WindowStateValue.TildOpen;
            }
            else
            {
                newState = WindowStateValue.Closed;
            }

            if (newState.Equals(_state))
            {
                return;
            }

            var oldState = GetState();

            _state = newState;

            if (!_settingsService.GetSettings <ComponentSettings>(this).IsEnabled)
            {
                return;
            }

            OnStateChanged(oldState);

            if (_state == WindowStateValue.Closed)
            {
                _messageBroker.Publish(Id, new WindowClosedEvent());
            }
            else
            {
                _messageBroker.Publish(Id, new WindowOpenedEvent());
            }
        }
Ejemplo n.º 7
0
        private void s_WindowStateChanged(object sender, WindowStateChangedEventArgs e)
        {
            if (e.NewWindowState != WindowState.Hidden)
            {
                return;
            }
            var dw = sender as XamDialogWindow;

            if (dw == null)
            {
                return;
            }

            try
            {
                ClearEvents(dw);
            }
            catch
            {
            }
        }
Ejemplo n.º 8
0
        private void Update(WindowStateChangedEventArgs eventArgs)
        {
            WindowStateValue newState;
            if (eventArgs.OpenReedSwitchState == AdapterSwitchState.Open)
            {
                newState = WindowStateValue.Open;
            }
            else if (eventArgs.TildReedSwitchState.HasValue && eventArgs.TildReedSwitchState.Value == AdapterSwitchState.Open)
            {
                newState = WindowStateValue.TildOpen;
            }
            else
            {
                newState = WindowStateValue.Closed;
            }

            if (newState.Equals(_state))
            {
                return;
            }

            var oldState = GetState();
            _state = newState;

            if (!_settingsService.GetSettings<ComponentSettings>(this).IsEnabled)
            {
                return;
            }

            OnStateChanged(oldState);

            if (_state == WindowStateValue.Closed)
            {
                ((Trigger)ClosedTrigger).Execute();
            }
            else
            {
                ((Trigger)OpenedTrigger).Execute();
            }
        }
Ejemplo n.º 9
0
 private void ActiveWindowState_WindowStateChanged(WindowStateChangedEventArgs args)
 {
     activeWindowState = args.NewWindowState;
     activeWindowState.Initialize();
     activeWindowState.WindowStateChanged += ActiveWindowState_WindowStateChanged;
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Fire when window state has changed
        /// </summary>
        ///<param name="e">Event data</param>
        private void OnWindowStateChanged(WindowStateChangedEventArgs e)
        {
            var handler = WindowStageChanged;

            handler?.Invoke(this, e);
        }