コード例 #1
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Resource.Id.refresh:
                var progressDialog = ProgressDialog.Show(this, null, "", true);
                new System.Threading.Thread(new ThreadStart(() =>
                {
                    ApprovalRepository repo = new ApprovalRepository();
                    //aprovalList = repo.GetApprovals(BitopiSingelton.Instance.User.UserCode).Result;
                    aprovalList = repo.GetApprovals(bitopiApplication.User.UserCode).Result;
                    RunOnUiThread(() =>
                    {
                        LoadView(aprovalList, progressDialog);
                    });
                })).Start();
                return(true);

            case Resource.Id.about:
                //BitopiSingelton.Instance.ShowAboutDialog(this);
                bitopiApplication.ShowAboutDialog(this);
                return(true);
            }
            return(base.OnOptionsItemSelected(item));
        }
コード例 #2
0
        protected async override void OnStart()
        {
            var progressDialog = ProgressDialog.Show(this, null, "", true);

            //try
            // {
            base.OnStart();

            ApprovalRepository repo = new ApprovalRepository();

            aprovalList = await repo.GetApprovals(bitopiApplication.User.UserCode);

            RunOnUiThread(() =>
            {
                LoadView(aprovalList, progressDialog);
            });
            ///}
            //catch (System.Exception ex)
            //{
            //    progressDialog.Dismiss();
            //    Toast.MakeText(this, ex.Message, ToastLength.Long).Show();
            //}
        }