private static void OnLasColumnExpandChanged(DependencyObject s, DependencyPropertyChangedEventArgs e) { ExtendedDataGrid dataGrid = (ExtendedDataGrid)s; if (e.NewValue == e.OldValue) { return; } dataGrid.ExpandLastColumn = (bool)e.NewValue; }
private static void OnCopyLinesMenuChanged(DependencyObject s, DependencyPropertyChangedEventArgs e) { ExtendedDataGrid dataGrid = (ExtendedDataGrid)s; if (e.NewValue == e.OldValue) { return; } if (e.Property == CopyCellsMenuProperty) { dataGrid.HandleCellsMenu(); } else if (e.Property == CopyLinesMenuProperty) { dataGrid.HandleLinesMenu(); } }
private static void OnAutoScrollChanged(DependencyObject s, DependencyPropertyChangedEventArgs e) { ExtendedDataGrid dataGrid = (ExtendedDataGrid)s; bool newValue = (bool)e.NewValue; bool oldValue = (bool)e.OldValue; var notifyCollection = dataGrid.Items as INotifyCollectionChanged; // Add the event handler in case that the property is set to true if (newValue && !oldValue) { notifyCollection.CollectionChanged += dataGrid.notifyCollection_CollectionChanged; } // Remove the event handle in case the property is set to false if (!newValue && oldValue) { notifyCollection.CollectionChanged -= dataGrid.notifyCollection_CollectionChanged; } }