Exemple #1
0
        private void addMember_Clicked(object sender, RoutedEventArgs e)
        {
            CustomPopupControl c = new CustomPopupControl();

            c.linkParent(popup);
            popup.IsOpen = true;

            c.popupText.Text      = "Choose a username name:";
            c.popupBox.Visibility = Visibility.Visible;

            c.popupButton.Click += async(s, args) =>
            {
                AddMemberVM service = new AddMemberVM();

                service.email    = c.popupBox.Text;
                service.groupeID = group._id;

                AddMemberRP res = await ApiCall.MakeCall("addMember", service);

                if (res.success)
                {
                    dial = new MessageDialog("Add user success");
                    await dial.ShowAsync();

                    UserList.Add(new ListItem(c.popupBox.Text));
                }
                else
                {
                    dial = new MessageDialog("Error: " + res.message);
                    await dial.ShowAsync();
                }
                popup.IsOpen = false;
            };
        }
Exemple #2
0
        private void addMember_Clicked(object sender, RoutedEventArgs e)
        {
            CustomPopupControl c = new CustomPopupControl();
            c.linkParent(popup);
            popup.IsOpen = true;

            c.popupText.Text = "Choose a username name:";
            c.popupBox.Visibility = Visibility.Visible;

            c.popupButton.Click += async (s, args) =>
            {
                AddMemberVM service = new AddMemberVM();

                service.email = c.popupBox.Text;
                service.groupeID = group._id;

                AddMemberRP res = await ApiCall.MakeCall("addMember", service);

                if (res.success)
                {
                    dial = new MessageDialog("Add user success");
                    await dial.ShowAsync();
                    UserList.Add(new ListItem(c.popupBox.Text));
                }
                else
                {
                    dial = new MessageDialog("Error: " + res.message);
                    await dial.ShowAsync();
                }
                popup.IsOpen = false;
            };
        }