示例#1
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SuperKittenEditView);

            FindViews();

            var selectedId = Intent.Extras.GetInt("selectedSuperKittenId");

            _isEditMode = selectedId > 0;
            _service    = new SuperKittensService();

            if (_isEditMode)
            {
                _kitten = await _service.GetById(selectedId);

                BindData();
            }
            else
            {
                _kitten = new SuperKitten();
            }

            _save.Click   += Save_Click;
            _image.Click  += TakePicture_Click;
            _cancel.Click += CancelOnClick;
        }
示例#2
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.SuperKittenDetailView);

            FindViews();

            var selectedId = Intent.Extras.GetInt("selectedSuperKittenId");

            _service = new SuperKittensService();
            _kitten  = await _service.GetById(selectedId);

            BindData();

            _edit.Click   += Edit_Click;
            _delete.Click += Delete_Click;
        }
示例#3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            _progress = new ProgressDialog(this)
            {
                Indeterminate = true
            };
            _progress.SetProgressStyle(ProgressDialogStyle.Spinner);
            _progress.SetMessage("Loading... Please wait...");
            _progress.SetCancelable(false);


            _kittensService = new SuperKittensService();

            FindViews();
            BindEvents();
        }