web UI
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using MudBlazor;
|
||||
using VisionBuilder.UI.Blazor.Dialogs;
|
||||
using VisionBuilder.UI.Common.ViewModel;
|
||||
using VisionBuilder.UI.Common.ViewModel.Interfaces.UI;
|
||||
|
||||
namespace VisionBuilder.UI.Blazor.Services;
|
||||
|
||||
public class BlazorRecipeSelectionDialogService : IRecipeSelectionDialogService
|
||||
{
|
||||
private IDialogService? _dialogService;
|
||||
|
||||
public void SetDialogService(IDialogService dialogService)
|
||||
{
|
||||
_dialogService = dialogService;
|
||||
}
|
||||
|
||||
public async Task<bool> SelectRecipeAsync(RecipeSelectionVM recipeSelectionVm)
|
||||
{
|
||||
if (_dialogService == null)
|
||||
return false;
|
||||
|
||||
var parameters = new DialogParameters<RecipeSelectionDialog>
|
||||
{
|
||||
{ x => x.ViewModel, recipeSelectionVm }
|
||||
};
|
||||
var dialog = await _dialogService.ShowAsync<RecipeSelectionDialog>("Select Recipe", parameters);
|
||||
var result = await dialog.Result;
|
||||
return result != null && !result.Canceled;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user