using Avalonia; using Avalonia.Controls.ApplicationLifetimes; using LindtLeerformPlugin.Views; using VisionBuilder.UI.Common.ViewModel.Interfaces.UI; namespace LindtLeerformPlugin; public class LeerformRecipeCreationTool : IRecipeCreationTool { public bool Enabled { get; set; } = true; public async Task CreateRecipeAsync() { if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop) return null; var parent = desktop.MainWindow; if (parent == null) return null; var dialog = new RecipeNameDialog(); var result = await dialog.ShowDialog(parent); return string.IsNullOrWhiteSpace(result) ? null : result; } }