예제 #1
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);
        }
예제 #2
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();
        }
예제 #3
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();
            };
        }
예제 #4
0
 public void SetSource(ITreeDataSource source, IBackend sourceBackend)
 {
     this.source     = source;
     tsource         = new TreeSource(source);
     Tree.DataSource = tsource;
 }