예제 #1
0
 public RedirectViewModel(IAnsDB ansDB)
 {
     answerDB = ansDB;
     if (MyGlobals.answer != null)
     {
         Answ sel = MyGlobals.answer;
         insertAns(sel.AnsFrom, sel.AnsTo, sel.AnsCal, sel.AnsLoc, sel.AnsExtra);
         MyGlobals.answer = null;
     }
     ShowViewModel <NotificationViewModel>();
 }
예제 #2
0
        public AnsViewModel(IDialogServiceP dialog, IToast toast, IAnsDB ansDB)
        {
            answerDB = ansDB;
            ReloadCommand.Execute(null);
            this.dialog = dialog;

            SelectMessage = new MvxCommand <Answ>(async selectedItem =>
            {
                string mes           = "from " + selectedItem.AnsFrom + "\n" + "Calendar: " + selectedItem.AnsCal + "\n" + "Location: " + selectedItem.AnsLoc + "\nOther Info:" + selectedItem.AnsExtra;
                List <string> Answer = await dialog.Show(mes, "Status Response", "Ok", "Delete");

                if (Answer[0] == "false")
                {
                    Message.Remove(selectedItem);
                    DeleteAns(selectedItem.Id);
                    toast.Show("Status Response Deleted");
                }
            });
        }