using MauiAppStock.Models;
using MauiAppStock.ViewModels;

namespace MauiAppStock.Views
{
    public partial class FournisseursPage : ContentPage
    {
        public FournisseursPage()
        {
            InitializeComponent();
        }

        protected override void OnAppearing()
        {
            base.OnAppearing();
            var viewModel = BindingContext as FournisseursViewModel;
            viewModel.LoadFournisseursCommand.Execute(null);
        }

        private async void OnAddFournisseurClicked(object sender, EventArgs e)
        {
            // Navigation vers la page d'ajout
            await Navigation.PushAsync(new AddFournisseurPage());
        }
    }
}