Beispiel #1
0
        public void SelectRow(TreePosition pos)
        {
            var it = tsource.GetItem(pos);

            if (it != null)
            {
                Table.SelectRow((int)Tree.RowForItem(it), Table.AllowsMultipleSelection);
            }
        }
Beispiel #2
0
        public void SelectItem(TreePosition pos)
        {
            var it = tsource.GetItem(pos);

            if (it != null)
            {
                Table.SelectRow(Tree.RowForItem(it), false);
            }
        }
Beispiel #3
0
        public void SetSource(ITreeDataSource source, IBackend sourceBackend)
        {
            this.source     = source;
            tsource         = new TreeSource(source);
            Tree.DataSource = tsource;

            source.NodeInserted   += (sender, e) => Tree.ReloadItem(tsource.GetItem(source.GetParent(e.Node)), true);
            source.NodeDeleted    += (sender, e) => Tree.ReloadItem(tsource.GetItem(e.Node), true);
            source.NodeChanged    += (sender, e) => Tree.ReloadItem(tsource.GetItem(e.Node), false);
            source.NodesReordered += (sender, e) => Tree.ReloadItem(tsource.GetItem(e.Node), true);
        }
Beispiel #4
0
        public void SetSource(ITreeDataSource source, IBackend sourceBackend)
        {
            this.source = source;
            RowHeights.Clear();
            tsource         = new TreeSource(source);
            Tree.DataSource = tsource;

            source.NodeInserted += (sender, e) => Tree.ReloadItem(tsource.GetItem(source.GetParent(e.Node)), true);
            source.NodeDeleted  += (sender, e) => Tree.ReloadItem(tsource.GetItem(e.Node), true);
            source.NodeChanged  += (sender, e) => {
                var item = tsource.GetItem(e.Node);
                Tree.ReloadItem(item, false);
                UpdateRowHeight(item);
            };
            source.NodesReordered += (sender, e) => Tree.ReloadItem(tsource.GetItem(e.Node), true);
            source.Cleared        += (sender, e) => Tree.ReloadData();
        }
Beispiel #5
0
        public void SetSource(ITreeDataSource source, IBackend sourceBackend)
        {
            this.source = source;
            RowHeights.Clear();
            tsource         = new TreeSource(source);
            Tree.DataSource = tsource;

            source.NodeInserted += (sender, e) => {
                var parent = tsource.GetItem(source.GetParent(e.Node));
                Tree.ReloadItem(parent, parent == null || Tree.IsItemExpanded(parent));
            };
            source.NodeDeleted += (sender, e) => {
                var parent = tsource.GetItem(e.Node);
                var item   = tsource.GetItem(e.Child);
                if (item != null)
                {
                    RowHeights.Remove(null);
                }
                Tree.ReloadItem(parent, parent == null || Tree.IsItemExpanded(parent));
            };
            source.NodeChanged += (sender, e) => {
                var item = tsource.GetItem(e.Node);
                if (item != null)
                {
                    Tree.ReloadItem(item, false);
                    UpdateRowHeight(item);
                }
            };
            source.NodesReordered += (sender, e) => {
                var parent = tsource.GetItem(e.Node);
                Tree.ReloadItem(parent, parent == null || Tree.IsItemExpanded(parent));
            };
            source.Cleared += (sender, e) =>
            {
                Tree.ReloadData();
                RowHeights.Clear();
            };
        }
Beispiel #6
0
 public override void InvalidateRowHeight(object pos)
 {
     UpdateRowHeight(tsource.GetItem((TreePosition)pos));
 }