protected void ClearPropertyChanged(BaseCellView nativeCell) { if (nativeCell.Cell is not CellBase formsCell) { return; } Shared.sv.SettingsView?parentElement = formsCell.Parent; formsCell.PropertyChanged -= nativeCell.CellPropertyChanged; if (parentElement is null) { return; } parentElement.PropertyChanged -= nativeCell.ParentPropertyChanged; if (formsCell.Section != null) { formsCell.Section.PropertyChanged -= nativeCell.SectionPropertyChanged; } }
protected void SetUpPropertyChanged(BaseCellView nativeCell) { if (nativeCell.Cell is not CellBase formsCell) { return; } Shared.sv.SettingsView?parentElement = formsCell.Parent; formsCell.PropertyChanged += nativeCell.CellPropertyChanged; if (parentElement is null) { return; } parentElement.PropertyChanged += nativeCell.ParentPropertyChanged; Section section = parentElement.Model.GetSectionFromCell(formsCell); if (section is null) { return; } formsCell.Section = section; formsCell.Section.PropertyChanged += nativeCell.SectionPropertyChanged; }