Browse Source

[14735]: MessageBox: fixed ArgulmentNullException when showing a messageBox before a window has loaded.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
606aeda9f9
  1. 27
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.cs

27
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/MessageBox.cs

@ -345,18 +345,21 @@ namespace Microsoft.Windows.Controls
/// <returns></returns>
private Window CreateContainer()
{
return new Window()
{
AllowsTransparency = true,
Background = Brushes.Transparent,
Content = this,
Owner = Window.GetWindow(ResolveOwner()),
ShowInTaskbar = false,
SizeToContent = System.Windows.SizeToContent.WidthAndHeight,
ResizeMode = System.Windows.ResizeMode.NoResize,
WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner,
WindowStyle = System.Windows.WindowStyle.None
};
var newWindow = new Window();
newWindow.AllowsTransparency = true;
newWindow.Background = Brushes.Transparent;
newWindow.Content = this;
var owner = ResolveOwner();
if (owner != null)
newWindow.Owner = Window.GetWindow(owner);
newWindow.ShowInTaskbar = false;
newWindow.SizeToContent = System.Windows.SizeToContent.WidthAndHeight;
newWindow.ResizeMode = System.Windows.ResizeMode.NoResize;
newWindow.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
newWindow.WindowStyle = System.Windows.WindowStyle.None;
return newWindow;
}
#endregion //Private

Loading…
Cancel
Save