using System;
using System.Collections.Generic;
using System.Text;
using CafeTerrace.Views.DialogBox;
using CafeTerrace.Views.PopUps;
using Rg.Plugins.Popup.Pages;
using Xamarin.Forms;

namespace CafeTerrace.Utilities
{
    public static class PopUpUtilites
    {
        public static PopupPage IndicatorPage
        {
            get
            {
                return new PopupPage
                {
                    CloseWhenBackgroundIsClicked = false,
                    Content = new Frame
                    {
                        BackgroundColor = Color.Accent,
                        VerticalOptions = LayoutOptions.Center,
                        HorizontalOptions = LayoutOptions.Center,
                        CornerRadius = 100,
                        Content = new ActivityIndicator
                        {
                            Color = (Color)Application.Current.Resources["PrimaryColor"],
                            WidthRequest = 70,
                            HeightRequest = 70,
                            IsRunning = true,
                            VerticalOptions = LayoutOptions.Center,
                            HorizontalOptions = LayoutOptions.Center
                        }
                    }
                };
            }
        }
        public static PopupPage SeccussPage(string message)
        {
            return new PopupPage
            {
                Content = new SeccussPopUp(message)
            };
        }
        public static PopupPage InfoPage(string message)
        {
            return new PopupPage
            {
                Content = new SeccussPopUp(message)
            };
        }
        public static PopupPage ErrorPage(string message)
        {
            return new PopupPage
            {
                Content = new ErrorPopUp(message)
            };
        }
        public static PopupPage PushNotify(string hi)
        {
            return new PopupPage
            {
                Content = new NotifyPopUp(hi)
            };
        }
        public static PopupPage ImagePopUp(string imageUrl)
        {
            return new PopupPage
            {
                Content = new ImageDialogBox
                {
                    BindingContext = imageUrl
                }
            };
        }
        public static PopupPage PersianDatePicker()
        {
            return new PopupPage
            {
                Content = new PersianDatePicker(),
                CloseWhenBackgroundIsClicked = false
            };
        }
    }
}
