コード例 #1
0
        public virtual void SetSource(IListDataSource source, IBackend sourceBackend)
        {
            this.source = source;

            RowHeights = new List <nfloat> ();
            for (int i = 0; i < source.RowCount; i++)
            {
                RowHeights.Add(-1);
            }

            tsource          = new ListSource(source);
            Table.DataSource = tsource;

            //TODO: Reloading single rows would be slightly more efficient.
            //      According to NSTableView.ReloadData() documentation,
            //      only the visible rows are reloaded.
            source.RowInserted += (sender, e) => {
                RowHeights.Insert(e.Row, -1);
                Table.ReloadData();
            };
            source.RowDeleted += (sender, e) => {
                RowHeights.RemoveAt(e.Row);
                Table.ReloadData();
            };
            source.RowChanged += (sender, e) => {
                UpdateRowHeight(e.Row);
                Table.ReloadData(NSIndexSet.FromIndex(e.Row), NSIndexSet.FromNSRange(new NSRange(0, Table.ColumnCount)));
            };
            source.RowsReordered += (sender, e) => { RowHeights.Clear(); Table.ReloadData(); };
        }
コード例 #2
0
ファイル: ListViewBackend.cs プロジェクト: akrisiun/xwt
        public virtual void SetSource(IListDataSource source, IBackend sourceBackend)
        {
            this.source      = source;
            tsource          = new ListSource(source);
            Table.DataSource = tsource;

            //TODO: Reloading single rows would be slightly more efficient.
            //      According to NSTableView.ReloadData() documentation,
            //      only the visible rows are reloaded.
            source.RowInserted   += (sender, e) => Table.ReloadData();
            source.RowDeleted    += (sender, e) => Table.ReloadData();
            source.RowChanged    += (sender, e) => Table.ReloadData();
            source.RowsReordered += (sender, e) => Table.ReloadData();
        }
コード例 #3
0
ファイル: ListViewBackend.cs プロジェクト: inorton/xwt
 public void SetSource(IListDataSource source, IBackend sourceBackend)
 {
     this.source      = source;
     tsource          = new ListSource(source);
     Table.DataSource = tsource;
 }