private void InitAsync()
        {
            _listView = new MultiLevelListView<MultiLevelItemBase>();
            _source = new ObservableCollection<MultiLevelItemBase>();

            _listView.ItemTemplate = new DataTemplate(typeof(TestCell));
            // The root page of your application
            Content = new ContentView()
            {
                Content = _listView
            };

            for (int i = 0; i < 3; i++)
            {
                var root = new MultiLevelItemBase() { Name = "Root " + i };
                _source.Add(root);
                for (int j = 0; j < 3; j++)
                {
                    var child1 = new MultiLevelItemBase() { Name = $"\tChild {i}-{j}" };
                    root.Children.Add(child1);
                    for (int k = 0; k < 3; k++)
                    {
                        var child2 = new MultiLevelItemBase() { Name = $"\t\tChild {i}-{j}-{k}" };
                        child1.Children.Add(child2);
                    }
                }
            }
            _listView.ItemsSource = _source;
        }
コード例 #2
0
 public ExpandableListDataSource(MultiLevelListView expandableListView, ExpandableListViewRenderer expandableListViewiOSRenderer) : this(expandableListView)
 {
     this._expandableListViewiOSRenderer = expandableListViewiOSRenderer;
 }
コード例 #3
0
 public ExpandableListViewDataAdaptor(Activity context, MultiLevelListView multiLevelListView)
 {
     FormsContext        = context;
     DataList            = multiLevelListView.Items;
     _multiLevelListView = multiLevelListView;
 }
コード例 #4
0
 public ExpandableListDataSource(MultiLevelListView expandableListView)
 {
     _items = expandableListView.Items;
     _multiLevelListView = expandableListView;
 }