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; } }
public void SetViews(CellViewCollection views) { ListBox.DisplayMemberPath = null; ListBox.ItemTemplate = new DataTemplate { VisualTree = CellUtil.CreateBoundColumnTemplate(views) }; }
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); }
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; } }
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; } }