using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rg.Plugins.Popup.Services;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace CafeTerrace.Views.PopUps
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class NotifyPopUp : ContentView
    {
        public NotifyPopUp()
        {
            InitializeComponent();
            init();
        }

        public NotifyPopUp(string mess)
        {
            InitializeComponent();
            messageLabel.Text = mess;
            init();
        }

        private async void init()
        {
            await notifyFrame.TranslateTo(0, -400, 10);
            await notifyFrame.TranslateTo(0, 0, 380);
        }

        private async void Button_OnClicked(object sender, EventArgs e)
        {
            if (PopupNavigation.Instance.PopupStack.Count > 0)
            {
                await notifyFrame.TranslateTo(0, -400, 300);
                await PopupNavigation.Instance.PopAllAsync();
            }
        }
    }
}