Example #1
0
        public override async Task Action(MessageResult message)
        {
            var call = message.GetData <CallbackData>();

            await message.ConfirmAction();

            await message.DeleteMessage();

            message.Handled = true;

            if (call.Value == "testform1")
            {
                var tf = new TestForm();

                await this.NavigateTo(tf);
            }
            else if (call.Value == "alert")
            {
                AlertDialog ad = new AlertDialog("This is a message", "Ok");

                ad.ButtonClicked += async(s, en) =>
                {
                    var fto = new TestForm2();
                    await this.NavigateTo(fto);
                };

                await this.NavigateTo(ad);
            }
            else if (call.Value == "confirm")
            {
                ConfirmDialog pd = new ConfirmDialog("Please confirm", new ButtonBase("Ok", "ok"), new ButtonBase("Cancel", "cancel"));

                pd.ButtonClicked += async(s, en) =>
                {
                    var tf = new TestForm2();

                    await pd.NavigateTo(tf);
                };

                await this.NavigateTo(pd);
            }
            else if (call.Value == "prompt")
            {
                PromptDialog pd = new PromptDialog("Please tell me your name ?");

                pd.Completed += async(s, en) =>
                {
                    await this.Device.Send("Hello " + pd.Value);
                };

                await this.OpenModal(pd);
            }
        }
Example #2
0
        public override async Task Action(MessageResult message)
        {
            var call = message.GetData <CallbackData>();

            await message.ConfirmAction();


            if (call == null)
            {
                return;
            }

            switch (call.Value)
            {
            case "text":

                var sf = new SimpleForm();

                await this.NavigateTo(sf);

                break;

            case "buttons":

                var bf = new ButtonTestForm();

                await this.NavigateTo(bf);

                break;

            case "progress":

                var pf = new ProgressTest();

                await this.NavigateTo(pf);

                break;

            case "registration":

                var reg = new Register.Start();

                await this.NavigateTo(reg);

                break;

            case "form1":

                var form1 = new TestForm();

                await this.NavigateTo(form1);

                break;

            case "form2":

                var form2 = new TestForm2();

                await this.NavigateTo(form2);

                break;

            case "data":

                message.Handled = true;

                var data = new DataForm();

                await this.NavigateTo(data);

                break;

            case "calendar":

                message.Handled = true;

                var calendar = new Controls.CalendarPickerForm();

                await this.NavigateTo(calendar);

                break;

            case "month":

                message.Handled = true;

                var month = new Controls.MonthPickerForm();

                await this.NavigateTo(month);

                break;

            case "treeview":

                message.Handled = true;

                var tree = new Controls.TreeViewForms();

                await this.NavigateTo(tree);

                break;

            case "togglebuttons":

                message.Handled = true;

                var tb = new Controls.ToggleButtons();

                await this.NavigateTo(tb);

                break;

            case "buttongrid":

                message.Handled = true;

                var bg = new Controls.ButtonGridForm();

                await this.NavigateTo(bg);

                break;

            case "buttongridfilter":

                message.Handled = true;

                var bg2 = new Controls.ButtonGridPagingForm();

                await this.NavigateTo(bg2);

                break;

            case "buttongridtags":

                message.Handled = true;

                var bg3 = new Controls.ButtonGridTagForm();

                await this.NavigateTo(bg3);

                break;

            case "multiview":

                message.Handled = true;

                var mvf = new MultiViewForm();

                await NavigateTo(mvf);


                break;

            case "checkedbuttonlist":

                message.Handled = true;

                var cbl = new CheckedButtonListForm();

                await NavigateTo(cbl);


                break;
            }
        }