Пример #1
0
        private void UpdateListView()
        {
            var from = new[] { "name", "commits" };
            var to = new[] { Resource.Id.TopCommittersWidget_committer_name, Resource.Id.TopCommittersWidget_number_of_commits };
            
            var data = _model.Committers
                            .Select(c =>
                                        {
                                            return new Dictionary<string, object>
                                                       {{"name", c.Name}, {"commits", c.Commits}, {"image", c.ImageUri}};
                                        })
                            .Cast<IDictionary<string, object>>().ToList();

            var listView = FindViewById<ListView>(Resource.Id.TopCommittersList);
            var topCommittersAdapter = new TopCommittersAdapter(Context, data, Resource.Layout.TopCommittersWidget_ListItem, from, to);
            topCommittersAdapter.SetModel(_model);
            listView.Adapter = topCommittersAdapter;
        }
Пример #2
0
        private void UpdateListView()
        {
            var from = new[] { "name", "commits" };
            var to   = new[] { Resource.Id.TopCommittersWidget_committer_name, Resource.Id.TopCommittersWidget_number_of_commits };

            var data = _model.Committers
                       .Select(c =>
            {
                return(new Dictionary <string, object>
                {
                    { "name", c.Name }, { "commits", c.Commits }, { "image", c.ImageUri }
                });
            })
                       .Cast <IDictionary <string, object> >().ToList();

            var listView             = FindViewById <ListView>(Resource.Id.TopCommittersList);
            var topCommittersAdapter = new TopCommittersAdapter(Context, data, Resource.Layout.TopCommittersWidget_ListItem, from, to);

            topCommittersAdapter.SetModel(_model);
            listView.Adapter = topCommittersAdapter;
        }