/// <summary>
 /// Reloads the assignment items in the Listview
 /// </summary>
 private void ReloadAssignmentItems ()
 {
     if (AssignmentItems != null) {
         var adapter = new ItemsAdapter (Activity, Resource.Layout.ItemLayout, AssignmentItems);
         adapter.Fragment = this;
         itemsListView.Adapter = adapter;
     }
 }
示例#2
0
 /// <summary>
 /// Reloads the assignment items in the Listview
 /// </summary>
 private void ReloadAssignmentItems()
 {
     if (AssignmentItems != null)
     {
         var adapter = new ItemsAdapter(Activity, Resource.Layout.ItemLayout, AssignmentItems);
         adapter.Fragment      = this;
         itemsListView.Adapter = adapter;
     }
 }
示例#3
0
        protected override void ListViewClicked(object sender, ItemClickEventArgs args)
        {
            base.ListViewClicked(sender, args);
            ItemsAdapter itm    = (ItemsAdapter)ListView.Adapter;
            Intent       intent = new Intent(this, typeof(ItemDetails));

            SetDefaultIntent(intent);
            intent.PutExtra("Item", itm.objectList[args.Position].GetString("Item"));
            StartActivity(intent);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            model     = new AuthorDataStore();
            viewModel = new ItemsViewModel <Author>(model);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            var recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);

            recyclerView.HasFixedSize       = true;
            recyclerView.SetAdapter(adapter = new ItemsAdapter(this, viewModel));

            addBtn = FindViewById <FloatingActionButton>(Resource.Id.fab);
        }
示例#5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here

            SetContentView(Resource.Layout.MainScreenLayout);
            var policiesView = FindViewById <ListView>(Resource.Id.policiesListView);
            var policiesList = new List <PolicyItem>
            {
                new PolicyItem {
                    Name = "Boiler", Description = "When I'm 1 kilometer away, turn boiler on"
                },
                new PolicyItem {
                    Name = "Lights", Description = "When I'm 100 meters away, turn lights on"
                }
            };

            var adapter = new ItemsAdapter(this, policiesList);

            policiesView.Adapter = adapter;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            presenter = new ItemsViewPresenter <Student>(this);

            Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.activity_main_toolbar);

            SetSupportActionBar(toolbar);

            var recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);

            recyclerView.HasFixedSize           = true;
            recyclerView.SetAdapter(adapterItem = new ItemsAdapter(this, presenter));

            adapterItem.ItemClick += OnItemClick;

            btnAdd        = FindViewById <FloatingActionButton>(Resource.Id.btn_add);
            btnAdd.Click += BtnAdd_Click;
        }
示例#7
0
 /// <inheritdoc />
 public Inventory(ItemsAdapter items, bool specificPrefixes = true): this(items as IList<ItemData>, specificPrefixes) {
   Contract.Requires<ArgumentNullException>(items != null);
 }