feat: add VisualLayerManager ctor to Notification & Toast manager.
This commit is contained in:
@@ -2,6 +2,7 @@ using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Metadata;
|
||||
using Avalonia.Controls.Notifications;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.Threading;
|
||||
|
||||
@@ -37,6 +38,14 @@ public class WindowNotificationManager : WindowMessageManager, INotificationMana
|
||||
set => SetValue(PositionProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WindowNotificationManager"/> class.
|
||||
/// </summary>
|
||||
public WindowNotificationManager()
|
||||
{
|
||||
UpdatePseudoClasses(Position);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WindowNotificationManager"/> class.
|
||||
/// </summary>
|
||||
@@ -49,10 +58,7 @@ public class WindowNotificationManager : WindowMessageManager, INotificationMana
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WindowNotificationManager"/> class.
|
||||
/// </summary>
|
||||
public WindowNotificationManager()
|
||||
public WindowNotificationManager(VisualLayerManager? visualLayerManager) : base(visualLayerManager)
|
||||
{
|
||||
UpdatePseudoClasses(Position);
|
||||
}
|
||||
|
||||
@@ -39,6 +39,17 @@ public abstract class WindowMessageManager : TemplatedControl
|
||||
VerticalAlignmentProperty.OverrideDefaultValue<WindowMessageManager>(VerticalAlignment.Stretch);
|
||||
}
|
||||
|
||||
public WindowMessageManager()
|
||||
{
|
||||
}
|
||||
|
||||
public WindowMessageManager(VisualLayerManager? visualLayerManager) : this()
|
||||
{
|
||||
if (visualLayerManager is null) return;
|
||||
visualLayerManager.AdornerLayer.Children.Add(this);
|
||||
AdornerLayer.SetAdornedElement(this, visualLayerManager.AdornerLayer);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Notifications;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Threading;
|
||||
|
||||
namespace Ursa.Controls;
|
||||
@@ -9,6 +10,13 @@ namespace Ursa.Controls;
|
||||
/// </summary>
|
||||
public class WindowToastManager : WindowMessageManager, IToastManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WindowToastManager"/> class.
|
||||
/// </summary>
|
||||
public WindowToastManager()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WindowToastManager"/> class.
|
||||
/// </summary>
|
||||
@@ -21,10 +29,7 @@ public class WindowToastManager : WindowMessageManager, IToastManager
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WindowToastManager"/> class.
|
||||
/// </summary>
|
||||
public WindowToastManager()
|
||||
public WindowToastManager(VisualLayerManager? visualLayerManager) : base(visualLayerManager)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user