public BrowseItemsPage()
 {
     InitializeComponent();
     BindingContext = _viewModel = new BrowseItemsViewModel();
     _viewModel.OnNavigateToDetails = async(detailsViewModel) =>
     {
         await Navigation.PushAsync(new DetailPage(detailsViewModel));
     };
 }
Exemplo n.º 2
0
        public BrowseItemsAdapter(Activity activity, BrowseItemsViewModel viewModel)
        {
            this.viewModel = viewModel;
            this.activity  = activity;

            this.viewModel.Items.CollectionChanged += (sender, args) => {
                this.activity.RunOnUiThread(NotifyDataSetChanged);
            };
        }
Exemplo n.º 3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ViewModel = new BrowseItemsViewModel();

            View view         = inflater.Inflate(Resource.Layout.fragment_browse, container, false);
            var  recyclerView =
                view.FindViewById <RecyclerView>(Resource.Id.recyclerView);

            recyclerView.HasFixedSize       = true;
            recyclerView.SetAdapter(adapter = new BrowseItemsAdapter(Activity, ViewModel));

            refresher = view.FindViewById <SwipeRefreshLayout>(Resource.Id.refresher);

            refresher.SetColorSchemeColors(Resource.Color.accent);

            progress            = view.FindViewById <ProgressBar>(Resource.Id.progressbar_loading);
            progress.Visibility = ViewStates.Gone;

            return(view);
        }
Exemplo n.º 4
0
        //private List<Item> Items;

        public MainPivot()
        {
            this.InitializeComponent();

            myViewModel     = new MyItemsViewModel();
            browseViewModel = new BrowseItemsViewModel();

            gvItems.ItemClick += GvItems_ItemClick;
            myItems.ItemClick += MyItems_ItemClick;
            myViewModel.Items.CollectionChanged += Items_CollectionChanged1;

            if (myViewModel.Items.Count == 0)
            {
                myViewModel.LoadItemsCommand.Execute(null);
            }

            browseViewModel.Items.CollectionChanged += Items_CollectionChanged;


            if (browseViewModel.Items.Count == 0)
            {
                browseViewModel.LoadItemsCommand.Execute(null);
            }
        }
        public BrowseItemsPage()
        {
            InitializeComponent();

            BindingContext = ViewModel = new BrowseItemsViewModel();
        }