using System;
using Xamarin.Forms;

namespace XamFormsMessagingCenter
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
        }

        protected override void OnAppearing()
        {
            base.OnAppearing();

            try
            {
                throw new NotSupportedException("To trzeba poprawić!");
            }
            catch(NotSupportedException ex)
            {
                MessagingCenter.Send<object, Exception>(this, MessagingKey.HandledException.ToString(), ex);
            }
        }
    }
}
