示例#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;
        }