private void OnChartDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { if (e.NewValue == null) { return; } UpdateChart(); }