Esempio n. 1
0
 public static SearchBar CreateSearchBar(GroupsPage page)
 {
     searchBar = new SearchBar {
         Placeholder = "Search here"
     };
     searchBar.TextChanged += (sender, e) => {
         page.SearchGroups();
     };
     return(searchBar);
 }
Esempio n. 2
0
        public ContextImageCell(GroupsPage page) : base()
        {
            this.Page  = page;
            SettingsMI = new MenuItem {
                Text = "Settings", Icon = "ic_settings_grey_500_24dp.png"
            };
            SettingsMI.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
            SettingsMI.Clicked += (sender, e) => {
                var mi = ((MenuItem)sender);
                GroupSelected = (GroupItem)mi.BindingContext;
                Debug.WriteLine("Settings tapped, adminid {0}", GroupSelected.adminuserID);
                CheckIfAdminThenAdaptOptions(GroupSelected.adminuserID);
            };

            InviteFriends = new MenuItem {
                Text = "Invite"
            };
            InviteFriends.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
            InviteFriends.Clicked += (sender, e) => {
                var mi = ((MenuItem)sender);
                GroupSelected = (GroupItem)mi.BindingContext;
                UserDialogs.Instance.WarnToast("Under construction");
            };

            LeaveThread = new MenuItem {
                Text = "Leave"
            };
            LeaveThread.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
            LeaveThread.Clicked += (sender, e) => {
                var mi = ((MenuItem)sender);
                GroupSelected = (GroupItem)mi.BindingContext;
                UserDialogs.Instance.Confirm(new ConfirmConfig {
                    OnConfirm = (bool obj) => {
                        UserDialogs.Instance.WarnToast("Under construction");
                    },
                    Title      = "This would be unwise...",
                    CancelText = "Keep me in the loop",
                    OkText     = "Yup",
                    Message    = "Are you sure you want to leave this Secret Thread? To rejoin, someone will have to invite you all over again..."
                });
            };

            ContextActions.Add(InviteFriends);
            //ContextActions.Add (LeaveThread);
            ContextActions.Add(SettingsMI);
        }