misc: update comment.

This commit is contained in:
Dong Bin
2025-03-28 11:52:23 +08:00
parent c2e7a217ab
commit ffc47f572f
3 changed files with 12 additions and 6 deletions

View File

@@ -70,6 +70,12 @@ public class WindowNotificationManager : WindowMessageManager, INotificationMana
VerticalAlignmentProperty.OverrideDefaultValue<WindowNotificationManager>(VerticalAlignment.Stretch);
}
/// <summary>
/// Tries to get the <see cref="WindowNotificationManager"/> from a <see cref="Visual"/>.
/// </summary>
/// <param name="visual">A <see cref="Visual"/> that is either a <see cref="Window"/> or a <see cref="VisualLayerManager"/>.</param>
/// <param name="manager">The existing <see cref="WindowNotificationManager"/> if found, or null if not found.</param>
/// <returns>True if a <see cref="WindowNotificationManager"/> is found; otherwise, false.</returns>
public static bool TryGetNotificationManager(Visual? visual, out WindowNotificationManager? manager)
{
manager = visual?.FindDescendantOfType<WindowNotificationManager>();

View File

@@ -84,12 +84,6 @@ public abstract class WindowMessageManager : TemplatedControl
}
}
public static bool TryGetMessageManager(Visual? visual, out WindowMessageManager? manager)
{
manager = visual?.FindDescendantOfType<WindowMessageManager>();
return manager is not null;
}
protected void TopLevelOnTemplateApplied(object? sender, TemplateAppliedEventArgs e)
{
if (Parent is AdornerLayer adornerLayer)

View File

@@ -35,6 +35,12 @@ public class WindowToastManager : WindowMessageManager, IToastManager
{
}
/// <summary>
/// Tries to get the <see cref="WindowToastManager"/> from a <see cref="Window"/> or <see cref="VisualLayerManager"/>.
/// </summary>
/// <param name="visual">A <see cref="Visual"/> that is either a <see cref="Window"/> or a <see cref="VisualLayerManager"/>.</param>
/// <param name="manager">The existing <see cref="WindowToastManager"/> if found, or null if not found.</param>
/// <returns>True if a <see cref="WindowToastManager"/> is found; otherwise, false.</returns>
public static bool TryGetToastManager(Visual? visual, out WindowToastManager? manager)
{
manager = visual?.FindDescendantOfType<WindowToastManager>();