|
|
@ -1,4 +1,6 @@
|
|
|
|
using AppException;
|
|
|
|
using AppException;
|
|
|
|
|
|
|
|
using CommunityToolkit.Maui.Storage;
|
|
|
|
|
|
|
|
using Microsoft.Maui.Controls;
|
|
|
|
using Model;
|
|
|
|
using Model;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
|
|
|
|
|
|
@ -99,5 +101,21 @@ namespace Views
|
|
|
|
description: "Suggestions",
|
|
|
|
description: "Suggestions",
|
|
|
|
recipes: Master.Recipe.GetRecipesByPriorityOrder(Master.User.CurrentConnected.Priorities)));
|
|
|
|
recipes: Master.Recipe.GetRecipesByPriorityOrder(Master.User.CurrentConnected.Priorities)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private async void ExportRecipe_Clicked(object sender, EventArgs e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var result = await FolderPicker.Default.PickAsync(FileSystem.Current.AppDataDirectory, new CancellationToken());
|
|
|
|
|
|
|
|
Master.Recipe.CurrentSelected = (Recipe)(sender as MenuFlyoutItem).BindingContext;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (result.IsSuccessful)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Master.Data.Export(Recipe, Path.Combine(result.Folder.Path, $"{Recipe.Id}.{Recipe.Title.Replace(" ", "")}.json"));
|
|
|
|
|
|
|
|
await DisplayAlert("Export", "Recipe was successfully exported.", "Ok");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await DisplayAlert("Export", "Unable to export recipe.", "Ok");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|