public void RemoveColumn(TableViewColumnBase value) { value.ThrowIfNull(); if (_columnDefinitions.Remove(value)) { value.PropertyChanged -= OnColumnPropertyChanged; ColumnChanged?.Invoke(value, EventArgs.Empty); } }
public void AddColumn(TableViewColumnBase value) { value.ThrowIfNull(); if (!_columnDefinitions.Add(value)) { throw new ApplicationException($"Passed column '{value.GetType().FullName}' was already defined. Ensure each column gets defined only once."); } value.PropertyChanged += OnColumnPropertyChanged; ColumnChanged?.Invoke(value, EventArgs.Empty); }
private async Task UpdateColumnAsync(int value) { if (ActualColumn == value) { return; } ActualColumn = value; if (ColumnChanged.HasDelegate) { await ColumnChanged.InvokeAsync(value); } else { Column = value; } }
private void OnColumnPropertyChanged(object?sender, PropertyChangedEventArgs args) { ColumnChanged?.Invoke(sender, EventArgs.Empty); }