|
<chart:FastStepLineBitmapSeries StrokeThickness="1"/>
|
|
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void DataModifyButton_Click(object sender, RoutedEventArgs e)
{
foreach (var series in this.chart.Series)
{
this.chart.SuspendSeriesNotification();
// Data point modifications.
this.chart.ResumeSeriesNotification();
}
}
}
|
|
Dim data As ObservableCollection(Of Model) = Nothing
data = TryCast(series.ItemsSource, ObservableCollection(Of Model))
Dim changed As INotifyPropertyChanged = TryCast(data.Last, INotifyPropertyChanged)
If changed IsNot Nothing Then
AddHandler changed.PropertyChanged, AddressOf OnItemPropertyChanged
End If
'series.SuspendNotification()
data.Last.YValue = 150
'series.ResumeNotification()
Console.WriteLine("time to modify data: " & sw.ElapsedMilliseconds)
End Sub
Private Sub OnItemPropertyChanged(sender As Object, e As PropertyChangedEventArgs)
series.SetIndividualPointData(viewModel.Data.Count-1, sender)
End Sub
End Class
Public Class FastStepLineBitmapSeriesExt : Inherits FastStepLineBitmapSeries
Public Function SetIndividualPointData(ByVal position As Double, ByRef sender As Object)
SetIndividualPoint(position, sender, True)
UpdateArea()
End Function
End Class |