Browse Source

extend api so that when a parent is set you can state if the current window becomes modal.

pull/3943/head
Dan Walmsley 6 years ago
parent
commit
313a292fc4
  1. 3
      src/Avalonia.Controls/Platform/IWindowImpl.cs
  2. 2
      src/Avalonia.Controls/Window.cs
  3. 2
      src/Avalonia.DesignerSupport/Remote/PreviewerWindowImpl.cs
  4. 2
      src/Avalonia.DesignerSupport/Remote/Stubs.cs
  5. 2
      src/Avalonia.Native/WindowImpl.cs
  6. 2
      src/Avalonia.X11/X11Window.cs
  7. 2
      src/Windows/Avalonia.Win32/WindowImpl.cs

3
src/Avalonia.Controls/Platform/IWindowImpl.cs

@ -29,7 +29,8 @@ namespace Avalonia.Platform
/// Sets the parent of the window.
/// </summary>
/// <param name="parent">The parent <see cref="IWindowImpl"/>.</param>
void SetParent(IWindowImpl parent);
/// <param name="isModal">If this window is modal or not.</param>
void SetParent(IWindowImpl parent, bool isModal);
/// <summary>
/// Disables the window for example when a modal dialog is open.

2
src/Avalonia.Controls/Window.cs

@ -539,7 +539,7 @@ namespace Avalonia.Controls
using (BeginAutoSizing())
{
PlatformImpl.SetParent(owner.PlatformImpl);
PlatformImpl.SetParent(owner.PlatformImpl, true);
Owner = owner;
owner.AddChild(this);
PlatformImpl?.Show();

2
src/Avalonia.DesignerSupport/Remote/PreviewerWindowImpl.cs

@ -117,7 +117,7 @@ namespace Avalonia.DesignerSupport.Remote
{
}
public void SetParent(IWindowImpl parent)
public void SetParent(IWindowImpl parent, bool isModal)
{
}

2
src/Avalonia.DesignerSupport/Remote/Stubs.cs

@ -130,7 +130,7 @@ namespace Avalonia.DesignerSupport.Remote
{
}
public void SetParent(IWindowImpl parent)
public void SetParent(IWindowImpl parent, bool isModal)
{
}

2
src/Avalonia.Native/WindowImpl.cs

@ -114,7 +114,7 @@ namespace Avalonia.Native
public Action GotInputWhenDisabled { get; set; }
public void SetParent(IWindowImpl parent)
public void SetParent(IWindowImpl parent, bool isModal)
{
}

2
src/Avalonia.X11/X11Window.cs

@ -1033,7 +1033,7 @@ namespace Avalonia.X11
ChangeWMAtoms(value, _x11.Atoms._NET_WM_STATE_ABOVE);
}
public void SetParent(IWindowImpl parent)
public void SetParent(IWindowImpl parent, bool isModal)
{
SetTransientParent((X11Window)parent);
}

2
src/Windows/Avalonia.Win32/WindowImpl.cs

@ -351,7 +351,7 @@ namespace Avalonia.Win32
public Action GotInputWhenDisabled { get; set; }
public void SetParent(IWindowImpl parent)
public void SetParent(IWindowImpl parent, bool isModal)
{
_parent = (WindowImpl)parent;
SetOwnerHandle(_parent._hwnd);

Loading…
Cancel
Save