Example #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.HotDogDetailView);

            HotDogDataService dataService = new HotDogDataService();

            selectedHotDog = dataService.GetHotDogById(1);

            var selectedHotDogId = Intent.Extras.GetInt("selectedHotDogId");

            selectedHotDog = dataService.GetHotDogById(selectedHotDogId);

            FindViews();
            BindData();
            HandleEvents();
        }
Example #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var favorites = new List <HotDog>()
            {
                dataService.GetHotDogById(1)
            };

            TableView.Source = new HotDogDataSource(favorites, this);
            this.ParentViewController.NavigationItem.Title = "Ray's Favorites";
        }
 protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data)
 {
     base.OnActivityResult(requestCode, resultCode, data);
     if (resultCode == Result.Ok && requestCode == 100)
     {
         var selectedHotDog = hotDogDataService.GetHotDogById(data.GetIntExtra("selectedHotDogId", 0));
         var dialog         = new AlertDialog.Builder(this);
         dialog.SetTitle("Confirmation");
         dialog.SetMessage($"You've added {data.GetIntExtra("amount",0)} time(s) the {selectedHotDog.Name}");
         dialog.Show();
     }
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.HotDogDetailView);

            mHotDogDataService = new HotDogDataService();
            mSelectedHotDog = mHotDogDataService.GetHotDogById(1);

            FindViews();
            BindData();
            HandleEvents();

        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.HotDogDetailView);
            _dataService = new HotDogDataService();
            int hotDogId = Intent.Extras.GetInt("selectedHotDogId");

            _selectedHotDog = _dataService.GetHotDogById(hotDogId);
            FindViews();
            BindData();
            HandleEvents();
            // Create your application here
        }
Example #6
0
        public override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);

            if (resultCode == Result.Ok && requestCode == 100)
            {
                var hotDog = dataService.GetHotDogById(data.Extras.GetInt("hotDogId"));
                var alert  = new AlertDialog.Builder(this.Activity);
                alert.SetTitle("Confirmation");
                alert.SetMessage($"You've added {data.Extras.GetInt("amount")} time(s) the {hotDog.Name}");
                alert.Show();
            }
        }
Example #7
0
        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);

            if (resultCode == Result.Ok && requestCode == 100)
            {
                var selectedHotDog = HotDogDataService.GetHotDogById(data.GetIntExtra("SelectedHotDogId", 0));
                var amount         = data.GetIntExtra("Amount", 0);
                var dialog         = new Android.App.AlertDialog.Builder(this);
                dialog.SetTitle("Confirmation");
                dialog.SetMessage($"You've added {amount} times the {selectedHotDog.Name}");
                dialog.Show();
            }
        }
Example #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.HotDogDetailView);

            dataService    = new HotDogDataService();
            selectedHotDog = dataService.GetHotDogById(1);

            // Create your application here
            FindViews();
            BindData();
            HandleEvents();
        }
Example #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            Window.SetSoftInputMode(SoftInput.StateAlwaysHidden);
            SetContentView(Resource.Layout.HotDogDetailsView);

            var hotDogId = Intent.Extras.GetInt("hotDogId");

            _dataService    = new HotDogDataService();
            _selectedHotDog = _dataService.GetHotDogById(hotDogId);

            FindViews();
            BindData();
            HandleEvents();
        }
Example #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            RequestWindowFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.HotDogDetailView);

            HotDogDataService dataService = new HotDogDataService();

            var selectedHotDogId = Intent.Extras.GetInt("selectedHotDogId"); //Get Int from the calling activity (HotDogId)

            selectedHotDog = dataService.GetHotDogById(selectedHotDogId);    //get HotDog object by Id

            FindViews();
            BindData();
            HandleEvents();
        }
Example #11
0
        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);

            if (resultCode == Result.Ok && requestCode == 100)
            {
                var selectedHotDog = hotDogDataService.GetHotDogById(data.GetIntExtra("selectedHotDogId", 0));

                //Track Event
                //Analytics.TrackEvent("Added Hotdog to basket", new Dictionary<string, string> { { "HotDog", selectedHotDog.Name }, { "Amount", data.GetIntExtra("amount", 0).ToString() } });

                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), selectedHotDog.Name));
                dialog.Show();
            }
        }
Example #12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            //set view
            SetContentView(Resource.Layout.HotDogDetailView);

            //instantiate data
            dataService    = new HotDogDataService();
            selectedHotDog = dataService.GetHotDogById(1);

            //get all the controls
            FindControls();
            BindData();
            HandleEvents();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource

            SetContentView(Resource.Layout.HotDogDetailView);

            //navigation demos
            var selectedHotDogId = Intent.Extras.GetInt("selectedHotDogId");

            dataService    = new HotDogDataService();
            selectedHotDog = dataService.GetHotDogById(selectedHotDogId);

            FindViews();

            BindData();

            HandleEvents();

            //Track Event
            //Analytics.TrackEvent("Opened detail", new Dictionary<string, string> { { "HotDog", selectedHotDog.Name }});
        }
        public HotDogDetailViewController(IntPtr handle) : base(handle)
        {
            HotDogDataService hotDogDataService = new HotDogDataService();

            SelectedHotDog = hotDogDataService.GetHotDogById(1);
        }
        public HotDogDetail2ViewController(IntPtr handle) : base(handle)
        {
            HotDogDataService hddService = new HotDogDataService();

            selected = hddService.GetHotDogById(1);
        }