47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
namespace MarketAlly.SpotlightTour.Maui;
|
|
|
|
/// <summary>
|
|
/// Scans the visual tree to find elements tagged with onboarding properties.
|
|
/// This static class delegates to DefaultStepScanner for backward compatibility.
|
|
/// For new code, consider using IStepScanner interface for better testability.
|
|
/// </summary>
|
|
public static class OnboardingScanner
|
|
{
|
|
private static readonly IStepScanner _scanner = DefaultStepScanner.Instance;
|
|
|
|
/// <summary>
|
|
/// Finds all onboarding steps within the given root element.
|
|
/// </summary>
|
|
/// <param name="root">The root element to scan.</param>
|
|
/// <param name="group">Optional group filter. If null, returns all steps.</param>
|
|
/// <returns>Ordered list of onboarding steps.</returns>
|
|
public static IReadOnlyList<OnboardingStep> FindSteps(Element root, string? group = null)
|
|
{
|
|
return _scanner.FindSteps(root, group);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Finds a specific step by its key.
|
|
/// </summary>
|
|
public static OnboardingStep? FindStepByKey(Element root, string stepKey)
|
|
{
|
|
return _scanner.FindStepByKey(root, stepKey);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets all unique group names found in the visual tree.
|
|
/// </summary>
|
|
public static IReadOnlyList<string> GetGroups(Element root)
|
|
{
|
|
return _scanner.GetGroups(root);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Counts the total number of steps, optionally filtered by group.
|
|
/// </summary>
|
|
public static int CountSteps(Element root, string? group = null)
|
|
{
|
|
return _scanner.CountSteps(root, group);
|
|
}
|
|
}
|