コード例 #1
0
        private async void Button_SaveOnClicked(object sender, EventArgs e)
        {
            string tmp = MyEntry.Text;

            if (tmp != null)
            {
                Match match = regex.Match(tmp);
                if (match.Success)
                {
                    var r = new CoAdminResources();



                    var admin = new CoAdmin
                    {
                        Email = tmp
                    };
                    await r.PostAdminAsync(admin);



                    await Navigation.PopAsync();
                }
                else
                {
                    await DisplayAlert(L10n.Localize("AlertLabel"), L10n.Localize("ValidationAlert"), L10n.Localize("OkAction"));
                }
            }
            else
            {
                await DisplayAlert(L10n.Localize("AlertLabel"), L10n.Localize("NullAlert"), L10n.Localize("OkAction"));
            }
        }
コード例 #2
0
        private async Task  InitializeDataAsync()
        {
            if (Device.OS == TargetPlatform.WinPhone)
            {
                Indicator.Scale    = 3;
                TheToolbarAdd.Icon = "add.png";
            }
            else if (Device.OS == TargetPlatform.Windows)
            {
                Indicator.Scale    = 4;
                TheToolbarAdd.Icon = "Assets/add.png";
            }
            else if (Device.OS == TargetPlatform.Android)
            {
                TheToolbarAdd.Icon = "Resources/drawable/add.png";
            }
            res = new CoAdminResources();
            Indicator.IsVisible = true;
            MyLayout.IsVisible  = false;

            CoAdminListView.ItemsSource = await res.GetAdminsAsync();



            MyLayout.IsVisible  = true;
            Indicator.IsRunning = false;
            Indicator.IsEnabled = false;
            Indicator.IsVisible = false;
        }