private void ListView_ItemHolding(object sender, ItemHoldingEventArgs e)
        {
            item        = e.ItemData as Contacts;
            popupLayout = new SfPopupLayout();
            popupLayout.PopupView.HeightRequest   = 100;
            popupLayout.PopupView.WidthRequest    = 100;
            popupLayout.PopupView.ContentTemplate = new DataTemplate(() =>
            {
                var mainStack             = new StackLayout();
                mainStack.BackgroundColor = Color.Teal;

                var deletedButton = new Button()
                {
                    Text            = "Delete",
                    HeightRequest   = 50,
                    BackgroundColor = Color.Teal,
                    TextColor       = Color.White
                };
                deletedButton.Clicked += DeletedButton_Clicked;
                var sortButton         = new Button()
                {
                    Text            = "Sort",
                    HeightRequest   = 50,
                    BackgroundColor = Color.Teal,
                    TextColor       = Color.White
                };
                sortButton.Clicked += SortButton_Clicked;
                mainStack.Children.Add(deletedButton);
                mainStack.Children.Add(sortButton);
                return(mainStack);
            });
            popupLayout.PopupView.ShowHeader = false;
            popupLayout.PopupView.ShowFooter = false;
            if (e.Position.Y + 100 <= ListView.Height && e.Position.X + 100 > ListView.Width)
            {
                popupLayout.Show((double)(e.Position.X - 100), (double)(e.Position.Y));
            }
            else if (e.Position.Y + 100 > ListView.Height && e.Position.X + 100 < ListView.Width)
            {
                popupLayout.Show((double)e.Position.X, (double)(e.Position.Y - 100));
            }
            else if (e.Position.Y + 100 > ListView.Height && e.Position.X + 100 > ListView.Width)
            {
                popupLayout.Show((double)(e.Position.X - 100), (double)(e.Position.Y - 100));
            }
            else
            {
                popupLayout.Show((double)e.Position.X, (double)(e.Position.Y));
            }
        }
        private void DisplayInitialPopup()
        {
            initialPopup = new SfPopupLayout();
            initialPopup.PopupView.AppearanceMode = AppearanceMode.OneButton;
            initialPopup.PopupView.PopupStyle.HeaderBackgroundColor = UIColor.White;
            initialPopup.PopupView.FooterHeight     = initialPopup.PopupView.FooterHeight - 10;
            initialPopup.PopupView.ShowFooter       = true;
            initialPopup.PopupView.ShowCloseButton  = false;
            initialPopup.PopupView.HeaderTitle      = "Book tickets !";
            initialPopup.PopupView.AcceptButtonText = "OK";
            initialPopup.StaysOpen = true;
            UILabel messageView = new UILabel();

            messageView.Text            = "Click on the book button to start booking tickets";
            messageView.TextColor       = UIColor.Black;
            messageView.LineBreakMode   = UILineBreakMode.WordWrap;
            messageView.Lines           = 5;
            messageView.TextAlignment   = UITextAlignment.Center;
            messageView.BackgroundColor = UIColor.White;
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            {
                initialPopup.PopupView.PopupStyle.HeaderFontSize = 14;
                messageView.Font             = UIFont.PreferredCaption1;
                initialPopup.PopupView.Frame = new CGRect(-1, -1, (UIScreen.MainScreen.ApplicationFrame.Width / 10) * 8, 180);
            }
            else
            {
                initialPopup.PopupView.PopupStyle.HeaderFontSize = 20;
                messageView.Font             = UIFont.PreferredBody;
                initialPopup.PopupView.Frame = new CGRect(-1, -1, -1, 200);
            }
            initialPopup.PopupView.ContentView = messageView;
            initialPopup.Show();
        }
        internal void DisplayInitialPopup()
        {
            if (pageExited)
            {
                return;
            }
            initialPopup = new SfPopupLayout(cont);
            initialPopup.PopupView.AppearanceMode            = AppearanceMode.OneButton;
            initialPopup.PopupView.ShowFooter                = true;
            initialPopup.PopupView.ShowCloseButton           = false;
            initialPopup.PopupView.HeaderTitle               = "Book tickets !";
            initialPopup.PopupView.AcceptButtonText          = "OK";
            initialPopup.PopupView.PopupStyle.HeaderTextSize = 16;
            initialPopup.StaysOpen = true;
            TextView messageView = new TextView(this.cont);

            messageView.Text = "Click on the book button to start booking tickets";
            messageView.SetTextColor(Color.Black);
            messageView.SetBackgroundColor(Color.White);
            messageView.TextSize = 14;
            initialPopup.PopupView.ContentView = messageView;
            initialPopup.PopupView.ContentView.SetPadding((int)(10 * density), (int)(10 * density), (int)(10 * density), (int)(10 * density));
            initialPopup.PopupView.PopupStyle.CornerRadius = 3;
            initialPopup.PopupView.HeightRequest           = 180;
            initialPopup.Show();
        }
Beispiel #4
0
        void SetSfPopupText(string HeaderText, string BodyText, AppearanceMode appearanceMode = AppearanceMode.OneButton, string AcceptText = "ACCEPT", string DeclineText = "DECLINE")
        {
            Label        popupContent;
            DataTemplate dataTemplate = new DataTemplate(() =>
            {
                popupContent                 = new Label();
                popupContent.Text            = BodyText;
                popupContent.FontFamily      = "Poppins";
                popupContent.FontSize        = Device.GetNamedSize(NamedSize.Medium, typeof(Label));
                popupContent.FontAttributes  = FontAttributes.Bold;
                popupContent.BackgroundColor = Color.White;
                return(popupContent);
            });
            SfPopupLayout sfPopup = new SfPopupLayout();

            sfPopup.PopupView.AppearanceMode    = appearanceMode;
            sfPopup.PopupView.AcceptButtonText  = AcceptText;
            sfPopup.PopupView.DeclineButtonText = DeclineText;
            sfPopup.PopupView.HeaderTitle       = HeaderText;
            sfPopup.PopupView.ContentTemplate   = dataTemplate;
            sfPopup.PopupView.AnimationMode     = AnimationMode.SlideOnTop;
            sfPopup.PopupView.AcceptCommand     = new Command(() => ShowChangePassword());
            sfPopup.PopupView.DeclineCommand    = new Command(() => DirectShowHomeview());
            sfPopup.Show();
        }
Beispiel #5
0
        private void sfChat_ImageTapped(object sender, ImageTappedEventArgs e)
        {
            popup = new SfPopupLayout();
            popup.PopupView.ShowHeader = false;

            DataTemplate bodyTemplateView = new DataTemplate(() =>
            {
                var imageView             = new Image();
                imageView.BackgroundColor = Color.Black;
                imageView.Source          = e.Message.Source;
                imageView.Margin          = new Thickness(0, 20, 0, 20);
                return(imageView);
            });

            DataTemplate footerTemplateView = new DataTemplate(() =>
            {
                var backButton      = new Button();
                backButton.Text     = "Go back to chat";
                backButton.Clicked += BackButton_Clicked;
                return(backButton);
            });

            popup.PopupView.ContentTemplate = bodyTemplateView;
            popup.PopupView.FooterTemplate  = footerTemplateView;
            popup.Show(true);
        }
Beispiel #6
0
        private void PrevButtonClicked(object sender, EventArgs e)
        {
            HoldPracID = PracID;
            PracID     = -1;      //stops code firing in PracticeModel.
            List <Data.End> ends = new List <Data.End>();
            int             srch; //int variable for parsing string to int

            int.TryParse(search, out srch);
            ends = Model.EndModel.GetPrev(srch, "Practice");
            string distDate = Model.DetailsModel.GetPrevDetails(ends);

            prevPop.PopupView.ContentTemplate = new DataTemplate(() =>
            {
                prevPop.Padding = 10;
                prevPop.PopupView.HeaderTitle  = "Prac" + distDate;
                prevPop.BackgroundColor        = Color.White;
                prevPop.HorizontalOptions      = LayoutOptions.FillAndExpand;
                prevPop.VerticalOptions        = LayoutOptions.FillAndExpand;
                prevPop.PopupView.WidthRequest = 360;
                prevPop.PopupView.ShowFooter   = false;
                return(CreateDataGridPrev(ends));
            });
            prevPop.StaysOpen = true;
            prevPop.PopupView.ShowCloseButton = true;
            prevPop.IsOpen = true;
            prevPop.Show();
            PracID = HoldPracID;
        }
Beispiel #7
0
        public IncrementalLoadingViewModel(Context context)
        {
            progress = new SfLinearProgressBar(context);
            popup    = new SfPopupLayout(context);
            string uri = "http://services.odata.org/Northwind/Northwind.svc/";

            if (CheckConnection(uri).Result)
            {
                popup.PopupView.ContentView     = progress;
                popup.PopupView.HeaderTitle     = "Fetching Data... ";
                popup.PopupView.ShowCloseButton = false;
                popup.PopupView.ShowFooter      = false;
                popup.PopupView.HeightRequest   = 125;
                popup.StaysOpen          = true;
                progress.Progress        = 100;
                progress.IsIndeterminate = true;
                popup.Show();

                gridSource = new IncrementalList <Order>(LoadMoreItems)
                {
                    MaxItemsCount = 1000
                };
                northwindEntity = new NorthwindEntities(new Uri(uri));
            }
            else
            {
                NoNetwork = true;
                IsBusy    = false;
            }
        }
 private void SfGrid_GridLoaded(object sender, GridLoadedEventArgs e)
 {
     // Fix for popup is not shown in OnBoardHelps sample opening.
     // Popup is not shown initially, Since we have set PopupView Hidden property to false from WillMoveToWindow override for collapsing the view visibility when goes to other window.
     canCollapseVisibilty    = true;
     sfPopUp.PopupView.Frame = new CGRect(this.Frame.Width - 25, this.Frame.Y, 150, 100);
     sfPopUp.Show();
 }
Beispiel #9
0
        async void foodLC_SelectionChanged(System.Object sender, Syncfusion.SfAutoComplete.XForms.SelectionChangedEventArgs e)
        {
            var fetchedUser = await Data.ReadAsync <User>(Preferences.Get("UserID", null), DefaultPartitions.UserDocuments);

            var resultUser = JsonConvert.DeserializeObject <User>(fetchedUser.JsonValue.ToString());
            var fetched    = await Data.ReadAsync <FoodRetriever>("public-food", DefaultPartitions.AppDocuments);

            //var fetchedUser = await Data.ReadAsync<User>(Preferences.Get("UserID", null), DefaultPartitions.UserDocuments);
            var result = JsonConvert.DeserializeObject <FoodRetriever>(fetched.JsonValue);

            //var resultUser = JsonConvert.DeserializeObject<User>(fetchedUser.JsonValue.ToString());

            if (e.AddedItems as Food1 != null)
            {
                var selectedFood = e.AddedItems as Food1;
                Console.WriteLine(selectedFood.Name);
                resultUser.Foods.Add(selectedFood);
                resultUser.Points += selectedFood.Points;
                await Data.ReplaceAsync(resultUser.Id.ToString(), resultUser, DefaultPartitions.UserDocuments);

                popupLayout = new SfPopupLayout();

                popupLayout.PopupView.ShowHeader      = false;
                popupLayout.PopupView.ShowFooter      = false;
                popupLayout.PopupView.ShowCloseButton = false;
                templateView = new DataTemplate(() =>
                {
                    popupContent      = new Label();
                    popupContent.Text = selectedFood.Name + " has been added. + " + selectedFood.Points + " points!";
                    popupContent.HorizontalTextAlignment = TextAlignment.Center;
                    popupContent.VerticalTextAlignment   = TextAlignment.Center;
                    popupContent.FontAttributes          = FontAttributes.Bold;
                    popupContent.FontSize = 15;


                    return(popupContent);
                });

                // Adding ContentTemplate of the SfPopupLayout
                popupLayout.PopupView.HeightRequest   = 120;
                popupLayout.PopupView.ContentTemplate = templateView;
                popupLayout.PopupView.AnimationMode   = AnimationMode.SlideOnBottom;



                await Task.Delay(2000);

                popupLayout.Show();


                await Task.Delay(2000);

                popupLayout.PopupView.AnimationMode = AnimationMode.SlideOnTop;
                popupLayout.IsOpen = false;
                this.FindByName <ListView>("foodLV").ItemsSource = resultUser.Foods.ToList();
            }
        }
 public void OnNavigatedTo(NavigationParameters parameters)
 {
     if (App.Current.MainPage != null)
     {
         SfPopupLayout popup = new SfPopupLayout();
         // Popup will be displayed when navigated to this page.
         popup.Show();
     }
 }
Beispiel #11
0
 private void ShowPopup(Point position)
 {
     if (position.Y + 100 <= TreeView.Height && position.X + 100 > TreeView.Width)
     {
         popupLayout.Show((double)(position.X - 100), (double)(position.Y));
     }
     else if (position.Y + 100 > TreeView.Height && position.X + 100 < TreeView.Width)
     {
         popupLayout.Show((double)position.X, (double)(position.Y - 100));
     }
     else if (position.Y + 100 > TreeView.Height && position.X + 100 > TreeView.Width)
     {
         popupLayout.Show((double)(position.X - 100), (double)(position.Y - 100));
     }
     else
     {
         popupLayout.Show((double)position.X, (double)(position.Y));
     }
 }
Beispiel #12
0
        /// <summary>
        /// Action to be performed when proceed button is clicked.
        /// </summary>
        /// <param name="confirmationPopup">Confirmation popup to be displayed.</param>
        private async void OnProceedButtonClicked(SfPopupLayout confirmationPopup)
        {
            if (this.currentTicketBookingPopup != null)
            {
                this.currentTicketBookingPopup.Dismiss();
            }

            await Task.Delay(200);

            confirmationPopup.Show();
        }
Beispiel #13
0
 public BusyIndicatorPopUpPage()
 {
     popupLayout  = new SfPopupLayout();
     templateView = new DataTemplate(() =>
     {
         SfBusyIndicator busyIndicator = new SfBusyIndicator();
         busyIndicator.AnimationType   = AnimationTypes.Ball;
         busyIndicator.ViewBoxWidth    = 150;
         busyIndicator.ViewBoxHeight   = 150;
         busyIndicator.TextColor       = Color.SkyBlue;
         return(busyIndicator);
     });
     popupLayout.PopupView.ContentTemplate = templateView;
     popupLayout.Show();
 }
Beispiel #14
0
        internal void ShowMessage(string message)
        {
            var view = popupLayout.PopupView;

            view.HeaderTitle      = " Message";
            view.ShowHeader       = true;
            view.ShowCloseButton  = true;
            view.AcceptButtonText = String.Empty;
            view.ContentTemplate  = new DataTemplate(() => new Label {
                Text = message,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalOptions         = LayoutOptions.Center
            });
            popupLayout.Show();
        }
Beispiel #15
0
 private void SfGrid_GridLoaded(object sender, GridLoadedEventArgs e)
 {
     if (MainActivity.isTablet)
     {
         sfPopUp.Show((int)(cont.Resources.DisplayMetrics.WidthPixels - (50 * density)), 0);
     }
     else
     {
         sfPopUp.Show((int)(cont.Resources.DisplayMetrics.WidthPixels - (25 * density)), 0);
     }
 }
Beispiel #16
0
 private void DetailsButtonClicked(object sender, EventArgs e)
 {
     popupLayout.PopupView.ContentTemplate = new DataTemplate(() =>
     {
         popupLayout.Padding = 10;
         popupLayout.PopupView.HeaderTitle     = "Details";
         popupLayout.PopupView.BackgroundColor = Color.White;
         popupLayout.HorizontalOptions         = LayoutOptions.FillAndExpand;
         prevPop.PopupView.WidthRequest        = 360;
         popupLayout.PopupView.ShowFooter      = false;
         return(CreateGrid());
     });
     popupLayout.StaysOpen = true;
     popupLayout.PopupView.ShowCloseButton = true;
     popupLayout.IsOpen = true;
     popupLayout.Show();
 }
Beispiel #17
0
        private void ValuesNull()
        {
            Label content = new Label {
                Text = "Please select a Bow Type and Distance from the drop down menus and try again.", TextColor = Color.FromHex("#010101"), BackgroundColor = Color.White, FontSize = 30
            };

            noBowOrDist.PopupView.ContentTemplate = new DataTemplate(() =>
            {
                noBowOrDist.Padding = 10;
                noBowOrDist.PopupView.HeaderTitle = "Choose from dropdowns";
                noBowOrDist.PopupView.ShowFooter  = false;
                return(content);
            });
            noBowOrDist.StaysOpen = true;
            noBowOrDist.PopupView.ShowCloseButton = true;
            noBowOrDist.IsOpen = true;
            noBowOrDist.Show();
        }
Beispiel #18
0
        private void ImageTapped(object args)
        {
            imagePopup = new SfPopupLayout();
            imagePopup.PopupView.ShowHeader    = false;
            imagePopup.PopupView.ShowFooter    = false;
            imagePopup.PopupView.AnimationMode = AnimationMode.Zoom;
            imagePopup.PopupView.PopupStyle.BorderThickness = 0;

            DataTemplate bodyTemplateView = new DataTemplate(() =>
            {
                imageView.BackgroundColor = Color.Black;
                imageView.Source          = (args as ImageTappedEventArgs).Message.Source;
                return(imageView);
            });

            imagePopup.PopupView.ContentTemplate = bodyTemplateView;
            imagePopup.Show(true);
        }
Beispiel #19
0
        static internal void ErrorMess(string e)
        {
            SfPopupLayout noBowOrDist = new SfPopupLayout();
            Label         err         = new Label {
                Text = e
            };

            noBowOrDist.PopupView.ContentTemplate = new DataTemplate(() =>
            {
                noBowOrDist.Padding = 10;
                noBowOrDist.PopupView.HeaderTitle = "Choose from dropdowns";
                noBowOrDist.PopupView.ShowFooter  = false;
                return(err);
            });
            noBowOrDist.StaysOpen = true;
            noBowOrDist.PopupView.ShowCloseButton = true;
            noBowOrDist.IsOpen = true;
            noBowOrDist.Show();
        }
Beispiel #20
0
        static public void NotValid(String score)
        {
            SfPopupLayout notValid = new SfPopupLayout();
            Label         content  = new Label {
                Text = "Entered score is not a valid score and will be recorded as a '0'. Please change your score.", TextColor = Color.FromHex("#010101"), BackgroundColor = Color.White, FontSize = 30
            };

            notValid.PopupView.ContentTemplate = new DataTemplate(() =>
            {
                notValid.Padding = 10;
                notValid.PopupView.HeaderTitle = "Invalid Score";
                notValid.PopupView.ShowFooter  = false;
                return(content);
            });
            notValid.StaysOpen = true;
            notValid.PopupView.ShowCloseButton = true;
            notValid.IsOpen = true;
            notValid.Show();
        }
Beispiel #21
0
        private void SelectEndRow()
        {
            Label content = new Label {
                Text = "Please Select a Row and try again.", TextColor = Color.Black, BackgroundColor = Color.White, FontSize = 30
            };

            selectEndRow.PopupView.ContentTemplate = new DataTemplate(() =>
            {
                selectEndRow.Padding = 10;
                selectEndRow.PopupView.HeaderTitle     = "Try Again";
                selectEndRow.PopupView.BackgroundColor = Color.White;
                selectEndRow.HorizontalOptions         = LayoutOptions.FillAndExpand;
                selectEndRow.PopupView.ShowFooter      = false;
                return(content);
            });
            selectEndRow.StaysOpen = true;
            selectEndRow.PopupView.ShowCloseButton = true;
            selectEndRow.IsOpen = true;
            selectEndRow.Show();
        }
Beispiel #22
0
        private void DisplayInitialPopup()
        {
            initialPopup = new SfPopupLayout(context);
            initialPopup.PopupView.AppearanceMode            = AppearanceMode.OneButton;
            initialPopup.PopupView.ShowFooter                = true;
            initialPopup.PopupView.ShowCloseButton           = false;
            initialPopup.PopupView.HeaderTitle               = "Notification !";
            initialPopup.PopupView.AcceptButtonText          = "OK";
            initialPopup.PopupView.PopupStyle.HeaderTextSize = 16;
            initialPopup.StaysOpen = true;
            TextView messageView = new TextView(context);

            messageView.Text = "Click on the contact tile to view the options";
            messageView.SetTextColor(Color.Black);
            messageView.SetBackgroundColor(Color.White);
            messageView.TextSize = 14;
            initialPopup.PopupView.ContentView = messageView;
            initialPopup.PopupView.ContentView.SetPadding((int)(10 * density), (int)(10 * density), (int)(10 * density), (int)(10 * density));
            initialPopup.PopupView.PopupStyle.CornerRadius = 3;
            initialPopup.PopupView.HeightRequest           = 180;
            initialPopup.Show();
        }
        private Task PreBumpWork()
        {
            return(Task.Factory.StartNew(() =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    bumpPop.Dismiss();
                    DataTemplate loadView = new DataTemplate(() =>
                    {
                        SfBusyIndicator busy = new SfBusyIndicator();
                        busy.IsBusy = true;
                        return busy;
                    });
                    loadPop.PopupView.ContentTemplate = loadView;
                    loadPop.PopupView.ShowFooter = false;
                    loadPop.PopupView.ShowHeader = false;
                    loadPop.ClosePopupOnBackButtonPressed = false;
                    loadPop.Show();
                });

                if (String.IsNullOrEmpty((string)gradeSel.SelectedValue) || String.IsNullOrWhiteSpace((string)gradeSel.SelectedValue))
                {
                    Device.BeginInvokeOnMainThread(() => {
                        gradeSel.Watermark = "Please select a grade";
                        loadPop.Dismiss();
                        bumpPop.Show();
                    });
                }
                else
                {
                    string grade = (string)gradeSel.SelectedValue;

                    Task.Run(async() => await BumpGrade(grade));
                }
            }));
        }
Beispiel #24
0
 /// <summary>
 /// Displays the full screen popup.
 /// </summary>
 /// <param name="popupLayout">Popup to be displayed.</param>
 private void DisplayFullScreenDialog(SfPopupLayout popupLayout)
 {
     popupLayout.Show(true);
 }
Beispiel #25
0
 /// <summary>
 /// Displays the dialog relative to the view.
 /// </summary>
 /// <param name="popupLayout">Popup to be displayed.</param>
 private void DisplayDialogRelativeToView(SfPopupLayout popupLayout)
 {
     popupLayout.Show();
 }
Beispiel #26
0
 /// <summary>
 /// Displays the popup as the modal window.
 /// </summary>
 /// <param name="popupLayout">Popup to be displayed.</param>
 private void DisplayModalDialog(SfPopupLayout popupLayout)
 {
     popupLayout.Show();
 }
Beispiel #27
0
 /// <summary>
 /// Displays the popup as the confirmation dialog.
 /// </summary>
 /// <param name="popupLayout">Popup to be displayed.</param>
 private void DisplayConfirmationDialog(SfPopupLayout popupLayout)
 {
     popupLayout.Show();
 }
Beispiel #28
0
 /// <summary>
 /// Displays the popup as the simple dialog.
 /// </summary>
 /// <param name="popupLayout">Popup to be displayed.</param>
 private void DisplaySimpleDialog(SfPopupLayout popupLayout)
 {
     popupLayout.Show();
 }
Beispiel #29
0
 /// <summary>
 /// Displays the popup as the dialog with title.
 /// </summary>
 /// <param name="popupLayout">Popup to be displayed.</param>
 private void DisplayAlertWithTitle(SfPopupLayout popupLayout)
 {
     popupLayout.Show();
 }
Beispiel #30
0
 /// <summary>
 /// Displays the popup as the alert.
 /// </summary>
 /// <param name="popupLayout">Popup to be displayed.</param>
 private void DisplayAlert(SfPopupLayout popupLayout)
 {
     popupLayout.Show();
 }