Ejemplo n.º 1
0
        private async Task OnTapCommandAsync()
        {
            try
            {
                var nav = Xamarin.Forms.DependencyService.Get <INavigation>();

                var calendar = new AtomCalendar();

                //calendar.BackgroundColor = Color.White;
                calendar.SelectedDate = this.Value;
                calendar.StartDate    = this.StartDate;
                calendar.EndDate      = this.EndDate;
                calendar.TapCommand   = new AtomCommand <AtomDateModel>(async(model) =>
                {
                    await Task.Delay(100);
                    Value = model.Value;

                    await nav.PopModalAsync(true);
                });


                Page page = new AtomPopupPage
                {
                    Content = calendar,
                    Title   = "Select Date"
                };


                //await Navigation.PushAsync(page);
                await nav.PushModalAsync(page);
            }
            catch (Exception ex) {
                UIAtomsApplication.Logger?.Invoke(ex.ToString());
            }
        }
Ejemplo n.º 2
0
        private async Task OnCommandAsync()
        {
            var c = Popup?.CreateContent() as VisualElement;

            if (c == null)
            {
                return;
            }

            var p = c as AtomPopupPage;

            if (p == null)
            {
                p = new AtomPopupPage {
                    Content = c as View
                };
            }
            p.SetBinding(AtomPopupPage.BindingContextProperty, new Binding {
                Path   = nameof(BindingContext),
                Source = this
            });
            p.Title = PopupTitle ?? Text;
            p.CloseWhenBackgroundIsClicked = CloseWhenClickedOutside;

            var nav = DependencyService.Get <INavigation>();
            await nav.PushModalAsync(p);
        }