internal void NotifySortingChanged(TableViewColumn column) { if (this.SortingChanged != null) { this.SortingChanged(this, new TableViewColumnEventArgs(column)); } }
internal void NotifyColumnWidthChanged(TableViewColumn column) { if (this.ColumnWidthChanged != null) { this.ColumnWidthChanged(this, new TableViewColumnEventArgs(column)); } }
public override void OnApplyTemplate() { base.OnApplyTemplate(); var col = this.Content as TableViewColumn; if (col != null) { this.ContentTemplate = col.TitleTemplate; this.Tag = col.Tag; if (col.UseHistogramm) { if (this.ContextMenu == null) { this.ContextMenu = new System.Windows.Controls.ContextMenu(); } System.Windows.Controls.MenuItem mi1 = new System.Windows.Controls.MenuItem(); mi1.Header = "Показать гистограмму"; mi1.IsCheckable = true; mi1.IsChecked = col.ShowHistogramm; mi1.Command = new Shared.Commands.DelegateCommand <TableViewColumn>(c => { TableViewColumn tableViewColumn = c; tableViewColumn.ShowHistogramm = !tableViewColumn.ShowHistogramm; }); mi1.CommandParameter = col; Binding b = new Binding("ShowHistogramm"); BindingOperations.SetBinding(mi1, ToggleButton.IsCheckedProperty, b); this.ContextMenu.Items.Add(mi1); } if (col.ContextMenu != null && col.ContextMenu.Items != null) { if (this.ContextMenu == null) { this.ContextMenu = new System.Windows.Controls.ContextMenu(); } foreach (System.Windows.Controls.MenuItem item in col.ContextMenu.Items) { System.Windows.Controls.MenuItem mi2 = new System.Windows.Controls.MenuItem(); mi2.Header = item.Header; mi2.Command = item.Command; mi2.CommandParameter = item.CommandParameter; mi2.Tag = item.Tag; this.ContextMenu.Items.Add(mi2); } } } }
internal void FocusedColumnChanged(TableViewColumn col) { this.FocusedColumnIndex = this.Columns.IndexOf(col); this.SelectedColumnIndex = this.FocusedColumnIndex; }
public TableViewColumnEventArgs(TableViewColumn column) { this.Column = column; }