コード例 #1
0
			/// <summary>
			///   Called when the view has been deactivated.
			/// </summary>
			/// <param name = "sender">The sender.</param>
			/// <param name = "e">The <see cref = "Caliburn.Micro.DeactivationEventArgs" /> instance containing the event data.</param>
			private void OnDeactivated(object sender, DeactivationEventArgs e)
			{
				((IDeactivate)_viewModel).Deactivated -= OnDeactivated;

				if (!e.WasClosed || _isDeactivatingFromView)
					return;

				_isDeactivatingFromViewModel = true;
				_isClosing = true;
				_view.Close();
				_isClosing = false;
				_isDeactivatingFromViewModel = false;
			}
コード例 #2
0
        /// <summary>
        /// Remove a panel from Avalondock.
        /// </summary>
        private void RemovePanel(object panel)
        {
            //
            // Look up the document in the content map.
            //
            ManagedContent managedContent = null;

            if (contentMap.TryGetValue(panel, out managedContent))
            {
                disableClosingEvent = true;

                try
                {
                    //
                    // The content was still in the map, and therefore still open, so close it.
                    //
                    managedContent.Close();
                }
                finally
                {
                    disableClosingEvent = false;
                }
            }
        }