You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SAE-2.01/MCTG/Views/ContentViews/RecipeCase.xaml.cs

39 lines
1.1 KiB

using Model;
using CommunityToolkit.Maui.Storage;
namespace Views;
public partial class RecipeCase : ContentView
{
public MasterManager Master => (Application.Current as App).Master;
public Recipe Recipe => Master.Recipe.CurrentSelected;
public RecipeCase()
{
InitializeComponent();
}
public static readonly BindableProperty CaseImageSourceProperty =
BindableProperty.Create("CaseImageSource", typeof(ImageSource), typeof(Image));
public ImageSource CaseImageSource
{
get => (ImageSource)GetValue(CaseImageSourceProperty);
set => SetValue(CaseImageSourceProperty, value);
}
public static readonly BindableProperty RecipeTitleProperty =
BindableProperty.Create("RecipeTitle", typeof(string), typeof(Label));
public string RecipeTitle
{
get => (string)GetValue(RecipeTitleProperty);
set => SetValue(RecipeTitleProperty, value);
}
private async void ImageButton_Clicked(object sender, EventArgs e)
{
Master.Recipe.CurrentSelected = (Recipe)(sender as ImageButton).BindingContext;
await Navigation.PushModalAsync(new ViewRecette());
}
}