Ejemplo n.º 1
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            SetContentView(Resource.Layout.Tabs);

            base.OnCreate(savedInstanceState);

            // Create your application here
            tabLayout              = FindViewById <TabLayout>(Resource.Id.mainTabLayout);
            tabLayout.TabSelected += TabLayout_TabSelected;
            currentUser            = JsonConvert.DeserializeObject <User>(Intent.GetStringExtra("user"));
            items = await ItemRepo.GetLocalItemsAsync(currentUser.City);


            fragmentNavigate(new BuyItemFragment(currentUser, items));
        }
Ejemplo n.º 2
0
        private async void TabLayout_TabSelected(object sender, TabLayout.TabSelectedEventArgs e)
        {
            switch (e.Tab.Position)
            {
            case 0:
                items = await ItemRepo.GetLocalItemsAsync(currentUser.City);

                fragmentNavigate(new BuyItemFragment(currentUser, items));
                break;

            case 1:
                items = await ItemRepo.GetCurrentUsersItemsAsync(currentUser.Id);

                fragmentNavigate(new ViewItemsFragment(currentUser, items));
                break;
            }
        }