Beispiel #1
0
        // InformationPopup contains a text and a bottom button.
        // Note that if text and icon are set to at the same time on the bottom button, they are overlaid.
        private void ShowInformationPopup()
        {
            var informationPopup = new InformationPopup()
            {
                Text = AppResources.WatchItemNamePagePopupText,
                IsProgressRunning = true
            };


            informationPopup.BackButtonPressed += (s, e) =>
            {
                informationPopup.Dismiss();
                informationPopup = null;
            };

            informationPopup.BottomButton = new MenuItem()
            {
                Text    = AppResources.WatchItemNamePageOkButtonText,
                Command = new Command(() =>
                {
                    informationPopup?.Dismiss();
                    informationPopup = null;
                })
            };

            informationPopup.Show();
        }
        public TCInformationPopup()
        {
            InitializeComponent();

            _textBottomButton = new MenuItem
            {
                Text    = "OK",
                Command = new Command(() =>
                {
                    Console.WriteLine("text bottom button Command!!");
                    _textButtonPopUp?.Dismiss();
                    _textButtonPopUp = null;
                })
            };

            _iconBottomButton = new MenuItem
            {
                IconImageSource = ImageSource.FromFile("image/tw_ic_popup_btn_delete.png"),
                Command         = new Command(() =>
                {
                    Console.WriteLine("icon bottom button Command!!");
                    _textButtonPopUp?.Dismiss();
                    _textButtonPopUp = null;
                })
            };

            _textIconBottomButton = new MenuItem
            {
                Text = "OK",
#pragma warning disable CS0618 // Icon is obsolete. This code is for checking backword compatibility.
                Icon = new FileImageSource
#pragma warning restore CS0618
                {
                    File = "image/tw_ic_popup_btn_delete.png",
                },
                Command = new Command(() =>
                {
                    Console.WriteLine("text&icon bottom button Command!!");
                    _textButtonPopUp?.Dismiss();
                    _textButtonPopUp = null;
                })
            };

            _colorBottomButton = new ColorMenuItem
            {
                Text            = "OK",
                BackgroundColor = Color.Blue,
                Command         = new Command(() =>
                {
                    Console.WriteLine("change color of bottom button Command!!");
                    _textButtonPopUp?.Dismiss();
                    _textButtonPopUp = null;
                })
            };

            _longText = @"This is scrollable popup text.
This part is made by adding long text in popup.Popup internally added
scroller to this layout when size of text is greater than total popup
height.This has two button in action area and title text in title area";
        }
        private void Button_OnClicked(object sender, EventArgs e)
        {
            var popup = new InformationPopup();

            popup.Title = "Alert";
            popup.Text  = "Sample Alert";
            popup.Show();
        }
 /// <summary>
 /// Displays loading popup.
 /// </summary>
 public void ShowLoadingPopup()
 {
     _informationPopup                   = new InformationPopup();
     _informationPopup.Title             = LoadingText;
     _informationPopup.Text              = LoadingText;
     _informationPopup.IsProgressRunning = true;
     _informationPopup.Show();
 }
Beispiel #5
0
        void createTextPopup()
        {
            _textPopUp = new InformationPopup();

            _textPopUp.BackButtonPressed += (s, e) =>
            {
                _textPopUp?.Dismiss();
                _textPopUp  = null;
                label1.Text = "text popup is dismissed";
            };
        }
Beispiel #6
0
        public SapService(Action onConnectedCallback)
        {
            _onConnectedCallback      = onConnectedCallback;
            _reconnectTimer.Elapsed  += ReconnectTimer_Elapsed;
            _reconnectTimer.AutoReset = true;

            TextPopUp = new InformationPopup();

            TextPopUp.BackButtonPressed += (s, e) =>
            {
                TextPopUp.Dismiss();
            };
        }
Beispiel #7
0
        public TCInformationPopup()
        {
            InitializeComponent();

            _textPopUp      = new InformationPopup();
            _textPopUp.Text = "This is text popup test";

            _textPopUp.BackButtonPressed += (s, e) =>
            {
                _textPopUp.Dismiss();
                label1.Text = "text popup is dismissed";
            };

            var bottomButton = new MenuItem()
            {
                Text    = "OK",
                Command = new Command(() =>
                {
                    Console.WriteLine("bottom button Command!!");
                    _textButtonPopUp.Dismiss();
                })
            };

            _textButtonPopUp              = new InformationPopup();
            _textButtonPopUp.Title        = "Popup title";
            _textButtonPopUp.Text         = "This is text and button popup test";
            _textButtonPopUp.BottomButton = bottomButton;

            _textButtonPopUp.BackButtonPressed += (s, e) =>
            {
                _textButtonPopUp.Dismiss();
                label1.Text = "text&button is dismissed";
            };

            _textButtonPopUp.BottomButton.Clicked += (s, e) =>
            {
                _textButtonPopUp.Dismiss();
                label1.Text = "text&button is dismissed";
            };

            _progressPopUp                   = new InformationPopup();
            _progressPopUp.Title             = "Popup title";
            _progressPopUp.Text              = "This is progress test";
            _progressPopUp.IsProgressRunning = true;

            _progressPopUp.BackButtonPressed += (s, e) =>
            {
                _progressPopUp.Dismiss();
                label1.Text = "progress is dismissed";
            };
        }
Beispiel #8
0
        void createProgressPopup()
        {
            _progressPopUp                   = new InformationPopup();
            _progressPopUp.Title             = "Popup title";
            _progressPopUp.Text              = "This is progress test";
            _progressPopUp.IsProgressRunning = true;

            _progressPopUp.BackButtonPressed += (s, e) =>
            {
                _progressPopUp?.Dismiss();
                _progressPopUp = null;
                label1.Text    = "progress is dismissed";
            };
        }
Beispiel #9
0
        public TCInformationPopup()
        {
            InitializeComponent();

            _textBottomButton = new MenuItem
            {
                Text    = "OK",
                Command = new Command(() =>
                {
                    Console.WriteLine("text bottom button Command!!");
                    _textButtonPopUp?.Dismiss();
                    _textButtonPopUp = null;
                })
            };

            _iconBottomButton = new MenuItem
            {
                Icon = new FileImageSource
                {
                    File = "image/tw_ic_popup_btn_delete.png",
                },
                Command = new Command(() =>
                {
                    Console.WriteLine("icon bottom button Command!!");
                    _textButtonPopUp?.Dismiss();
                    _textButtonPopUp = null;
                })
            };

            _textIconBottomButton = new MenuItem
            {
                Text = "OK",
                Icon = new FileImageSource
                {
                    File = "image/tw_ic_popup_btn_delete.png",
                },
                Command = new Command(() =>
                {
                    Console.WriteLine("text&icon bottom button Command!!");
                    _textButtonPopUp?.Dismiss();
                    _textButtonPopUp = null;
                })
            };

            _longText = @"This is scrollable popup text.
This part is made by adding long text in popup.Popup internally added
scroller to this layout when size of text is greater than total popup
height.This has two button in action area and title text in title area";
        }
Beispiel #10
0
        /// <summary>
        /// Shows no results popup.
        /// </summary>
        public void ShowNoResultsPopup()
        {
            MenuItem bottomButton = new MenuItem()
            {
                Text    = NoResultsPopupButtonText,
                Command = new Command(() =>
                {
                    Dismiss();
                })
            };

            _informationPopup              = new InformationPopup();
            _informationPopup.Text         = NoResultsPopupText;
            _informationPopup.BottomButton = bottomButton;
            _informationPopup.Show();
        }
        /// <summary>
        /// Shows error popup with action button.
        /// </summary>
        public void ShowErrorPopup()
        {
            InformationPopup informationPopup = new InformationPopup();
            MenuItem         bottomButton     = new MenuItem()
            {
                Text    = ErrorPopupButtonText,
                Command = new Command(() =>
                {
                    informationPopup.Dismiss();
                })
            };

            informationPopup.Text         = ErrorPopupText;
            informationPopup.BottomButton = bottomButton;
            informationPopup.Show();
        }
        /// <summary>
        /// Shows error popup with action button.
        /// </summary>
        public void ShowErrorPopup()
        {
            InformationPopup informationPopup = new InformationPopup();
            MenuItem         bottomButton     = new MenuItem()
            {
                Text    = ErrorPopupButtonText,
                Command = new Command(() =>
                {
                    DependencyService.Get <IPageNavigation>().GoBack();
                    informationPopup.Dismiss();
                })
            };

            informationPopup.Text         = ErrorPopupText;
            informationPopup.BottomButton = bottomButton;

            informationPopup.Show();
        }
Beispiel #13
0
        void createTextButtonPopup()
        {
            _textButtonPopUp              = new InformationPopup();
            _textButtonPopUp.Title        = "Popup title";
            _textButtonPopUp.Text         = "This is text and button popup test";
            _textButtonPopUp.BottomButton = _textBottomButton;

            _textButtonPopUp.BackButtonPressed += (s, e) =>
            {
                _textButtonPopUp?.Dismiss();
                _textButtonPopUp = null;
                label1.Text      = "text&button is dismissed";
            };

            _textButtonPopUp.BottomButton.Clicked += (s, e) =>
            {
                _textButtonPopUp?.Dismiss();
                _textButtonPopUp = null;
                label1.Text      = "text&button is dismissed";
            };
        }
Beispiel #14
0
        protected static InformationPopup CreateTextPopup(string text, string title = null, Action backButtonAction = null, bool dismissOnBackButtonPressed = true)
        {
            var textPopUp = new InformationPopup {
                Text = text
            };

            if (title != null)
            {
                textPopUp.Title = title;
            }

            if (dismissOnBackButtonPressed)
            {
                textPopUp.BackButtonPressed += (s, e) => textPopUp.Dismiss();
            }

            if (backButtonAction != null)
            {
                textPopUp.BackButtonPressed += (s, e) => backButtonAction.Invoke();
            }
            return(textPopUp);
        }
Beispiel #15
0
        public TCPerformance()
        {
            Console.WriteLine($"TCPerformance");
            EcoreAnimator      = DependencyService.Get <IEcoreAnimator>(DependencyFetchTarget.NewInstance);
            GlobalScrollConfig = DependencyService.Get <IGlobalScrollConfig>(DependencyFetchTarget.NewInstance);

            InitializeListItem();

            int index = 0;

            _listView = new RenderCircleListView
            {
                ItemsSource  = _testData,
                ItemTemplate = new DataTemplate(() =>
                {
                    var cell = new MyViewCell
                    {
                        Text = _testData[index++].Label
                    };
                    return(cell);
                }),
            };

            _popUp = new InformationPopup();
            _popUp.BackButtonPressed += (s, e) =>
            {
                _popUp.Dismiss();
            };

            // start performance check
            _listView.Changed       += OnStartCalculator;
            _listView.ScrollStarted += OnStartCheckFps;
            _listView.ScrollStopped += StopCheckFps;


            Content = _listView;
        }
Beispiel #16
0
        private async void ccControls_DateClicked(object sender, EventArgs e)
        {
            var item = (Xamarin.Forms.Button)sender;

            var day   = int.Parse(item.Text);
            var month = int.Parse(ccControls.Month);
            var year  = int.Parse(ccControls.Year);

            var data = ccControls.AlertDates.Where(x => x.ExpiringDates.Any(y => y.Day == day && y.Month == month && y.Year == year));

            if (data.FirstOrDefault() != null)
            {
                string content     = "\nExpired vacations date(s): \n\n";
                int    itemCounter = 1;
                foreach (var d in data.FirstOrDefault().ExpiringDates)
                {
                    content += "•\t\t\t\t" + d.ToShortDateString() + "\n";
                    itemCounter++;
                }

                informationPopup = new InformationPopup("Expired Vacations", data.FirstOrDefault().EmployeeName, content);
                await PopupNavigation.Instance.PushAsync(informationPopup);
            }
        }