コード例 #1
0
 private void ShowWindow()
 {
     if (_windowViewModel != null)
     {
         _windowViewModel.Conductor.ActivateItemAsync(_windowViewModel);
     }
     else
     {
         _windowViewModel              = new WindowViewModel();
         _windowViewModel.Activated   += OnWindowActivated;
         _windowViewModel.Deactivated += OnWindowDeactivated;
         _windowService.ShowWindow(_windowViewModel);
     }
 }
コード例 #2
0
        private void OnWindowDeactivated(object sender, DeactivationEventArgs eventArgs)
        {
            Log.Add("Window deactivated");

            if (eventArgs.Closed)
            {
                _windowViewModel.Activated   -= OnWindowActivated;
                _windowViewModel.Deactivated -= OnWindowDeactivated;
                _windowViewModel              = null;
                Log.Add("Window closed");
            }

            RefreshButtons();
        }
コード例 #3
0
 private void ShowWindow()
 {
     if (_windowViewModel != null)
     {
         _windowViewModel.Conductor.ActivateItemAsync(_windowViewModel);
     }
     else
     {
         _windowViewModel = new WindowViewModel();
         _windowViewModel.Activated += OnWindowActivated;
         _windowViewModel.Deactivated += OnWindowDeactivated;
         _windowService.ShowWindow(_windowViewModel);
     }
 }
コード例 #4
0
        private void OnWindowDeactivated(object sender, DeactivationEventArgs eventArgs)
        {
            Log.Add("Window deactivated");

            if (eventArgs.Closed)
            {
                _windowViewModel.Activated -= OnWindowActivated;
                _windowViewModel.Deactivated -= OnWindowDeactivated;
                _windowViewModel = null;
                Log.Add("Window closed");
            }

            RefreshButtons();
        }