コード例 #1
0
ファイル: TreeViewBackend.cs プロジェクト: nbros/xwt
        public void UpdateColumn(ListViewColumn column, object handle, ListViewColumnChange change)
        {
            var col = ((GridViewColumn)handle);

            switch (change)
            {
            case ListViewColumnChange.Title:
                col.Header = column.Title;
                break;

            case ListViewColumnChange.Cells:
                var cellTemplate = CellUtil.CreateBoundColumnTemplate(column.Views);

                col.CellTemplate = new DataTemplate {
                    VisualTree = cellTemplate
                };

                int index = Tree.View.Columns.IndexOf(col);
                if (index == 0)
                {
                    var dockFactory = CreateExpanderDock();
                    dockFactory.AppendChild(cellTemplate);

                    col.CellTemplate.VisualTree = dockFactory;
                }

                break;
            }
        }
コード例 #2
0
 public void SetViews(CellViewCollection views)
 {
     ListBox.DisplayMemberPath = null;
     ListBox.ItemTemplate      = new DataTemplate {
         VisualTree = CellUtil.CreateBoundColumnTemplate(views)
     };
 }
コード例 #3
0
        public object AddColumn(ListViewColumn col)
        {
            var column = new GridViewColumn();

            column.CellTemplate = new DataTemplate {
                VisualTree = CellUtil.CreateBoundColumnTemplate(Context, this, col.Views)
            };
            if (col.HeaderView != null)
            {
                column.HeaderTemplate = new DataTemplate {
                    VisualTree = CellUtil.CreateBoundCellRenderer(Context, this, col.HeaderView)
                }
            }
            ;
            else
            {
                column.Header = col.Title;
            }

            this.view.Columns.Add(column);

            MapColumn(col, column);

            return(column);
        }
コード例 #4
0
ファイル: TreeViewBackend.cs プロジェクト: directhex/xwt
        public void UpdateColumn(ListViewColumn column, object handle, ListViewColumnChange change)
        {
            var col = ((GridViewColumn)handle);

            switch (change)
            {
            case ListViewColumnChange.Title:
                col.Header = column.Title;
                break;

            case ListViewColumnChange.Cells:
                var cellTemplate = CellUtil.CreateBoundColumnTemplate(Context, Frontend, column.Views);

                col.CellTemplate = new DataTemplate {
                    VisualTree = cellTemplate
                };

                int index = Tree.View.Columns.IndexOf(col);
                if (index == 0)
                {
                    var dockFactory = CreateExpanderDock();
                    dockFactory.AppendChild(cellTemplate);

                    col.CellTemplate.VisualTree = dockFactory;
                }

                break;

            case ListViewColumnChange.Alignment:
                var style = new Style(typeof(GridViewColumnHeader));
                style.Setters.Add(new Setter(Control.HorizontalContentAlignmentProperty, Util.ToWpfHorizontalAlignment(column.Alignment)));
                col.HeaderContainerStyle = style;
                break;
            }
        }
コード例 #5
0
ファイル: ListViewBackend.cs プロジェクト: TilmanGriesel/xwt
        public void UpdateColumn(ListViewColumn col, object handle, ListViewColumnChange change)
        {
            var column = (GridViewColumn)handle;

            column.CellTemplate = new DataTemplate {
                VisualTree = CellUtil.CreateBoundColumnTemplate(Context, Frontend, col.Views)
            };
            if (col.HeaderView != null)
            {
                column.HeaderTemplate = new DataTemplate {
                    VisualTree = CellUtil.CreateBoundCellRenderer(Context, Frontend, col.HeaderView)
                }
            }
            ;
            else
            {
                column.Header = col.Title;
            }
        }