using CommunityToolkit.Mvvm.Messaging;
using salesbook.Shared.Core.Messages.Back;

namespace salesbook.Maui
{
    public partial class MainPage : ContentPage
    {
        private readonly IMessenger _messenger;
        
        public MainPage(IMessenger messenger)
        {
            InitializeComponent();
            _messenger = messenger;
        }

        protected override bool OnBackButtonPressed()
        {
            _messenger.Send(new HardwareBackMessage("back"));
            return true;
        }

    }
}
