这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This program is provided to you under the terms of the Microsoft Public
***********************************************************************************/

using System;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Runtime.InteropServices;
Expand Down Expand Up @@ -58,6 +59,7 @@ protected LayoutFloatingWindowControl( ILayoutElement model )
{
this.Loaded += new RoutedEventHandler( OnLoaded );
this.Unloaded += new RoutedEventHandler( OnUnloaded );
Closing += OnClosing;
_model = model;
}

Expand Down Expand Up @@ -453,6 +455,19 @@ private void OnUnloaded( object sender, RoutedEventArgs e )
}
}

private void OnClosing(object sender, CancelEventArgs e)
{
Closing -= OnClosing;

// If this window was Closed not from InternalClose method,
// mark it as closing to avoid "InvalidOperationException: : Cannot set Visibility to Visible or call Show, ShowDialog,
// Close, or WindowInteropHelper.EnsureHandle while a Window is closing".
if (!_isClosing)
{
_isClosing = true;
}
}

private void OnActivated( object sender, EventArgs e )
{
this.Activated -= new EventHandler( OnActivated );
Expand Down