protected void OnSelectionChanged() { // Simpler than binding with MVVM since .ctor() is being called. if (converterList.ConstructSelectedType() is IAreaConverter converter) { topGroup.Text = converter.Top; leftGroup.Text = converter.Left; bottomGroup.Text = converter.Bottom; rightGroup.Text = converter.Right; applyButton.Enabled = true; } else { topGroup.Text = string.Empty; leftGroup.Text = string.Empty; bottomGroup.Text = string.Empty; rightGroup.Text = string.Empty; applyButton.Enabled = false; } }
protected void OnSelectionChanged() { var converter = converterList.ConstructSelectedType(); if (converter != null) { topGroup.Text = converter.Top; leftGroup.Text = converter.Left; bottomGroup.Text = converter.Bottom; rightGroup.Text = converter.Right; applyButton.Enabled = true; } else { topGroup.Text = string.Empty; leftGroup.Text = string.Empty; bottomGroup.Text = string.Empty; rightGroup.Text = string.Empty; applyButton.Enabled = false; } }