コード例 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Instantiate
            mDeals = new DealCollection();
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our RecyclerView layout:
            mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);



            // Use the built-in linear layout manager:
            mLayoutManager = new LinearLayoutManager(this);
            // Plug the layout manager into the RecyclerView:
            mRecyclerView.SetLayoutManager(mLayoutManager);

            //............................................................
            // Adapter Setup:

            // Create an adapter for the RecyclerView, and pass it the
            // data set (the photo album) to manage:
            mAdapter = new DealAdapter(mDeals, this);


            // Plug the adapter into the RecyclerView:
            mRecyclerView.SetAdapter(mAdapter);


            DispatcherHelper.Initialize();
            var nav = new NavigationService();

            SimpleIoc.Default.Register <INavigationService>(() => nav);
            nav.Configure(ViewModelLocator.DetailPageKey, typeof(DetailDeal));
        }
コード例 #2
0
    //// Underlying data set
    //public DealCollection mDealCollection;



    // Load the adapter with the data set
    public DealAdapter(DealCollection dealCollection, IDealItemClickListener dealItemClickListener)
    {
        //mDealCollection = dealCollection;
        mDealItemClickListener = dealItemClickListener;
    }