Пример #1
0
        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);

            if (resultCode == Result.Ok && requestCode == 100)
            {
                var selectedBurger = BurgerDataService.GetBurgerById(data.GetIntExtra("selectedBurgerId", 0));

                var dialog = new AlertDialog.Builder(this);
                dialog.SetTitle("Confirmation");
                dialog.SetMessage(string.Format("You've added {0} time(s) the {1}", data.GetIntExtra("amount", 0), selectedBurger.Name));
                dialog.Show();
            }
        }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here

            SetContentView(Resource.Layout.BurgerDetailView);

            BurgerDataService dataService = new BurgerDataService();
            var selectedBurgerId          = Intent.Extras.GetInt("selectedBurgerId");

            _selectedBurger = dataService.GetBurgerById(selectedBurgerId);

            FindViews();

            BindData();

            HandleEvents();
        }