Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143193 | Mar 8,2019 11:21 AM UTC | Mar 13,2019 06:59 AM UTC | WPF | 3 |
![]() |
Tags: SfChart |
public class BubbleSeriesExt : BubbleSeries
{
protected override void OnDataSourceChanged(IEnumerable oldValue, IEnumerable newValue)
{
base.OnDataSourceChanged(oldValue, newValue);
if(ItemsSource != null && ListenPropertyChange)
foreach (var item in ItemsSource as IEnumerable)
{
INotifyPropertyChanged data = item as INotifyPropertyChanged;
if (data != null)
{
data.PropertyChanged -= OnItemPropertyChanged;
data.PropertyChanged += OnItemPropertyChanged;
}
}
}
void OnItemPropertyChanged(object sender, PropertyChangedEventArgs e)
{
int position = -1;
IEnumerable itemsSource = (ItemsSource as IEnumerable);
foreach (object obj in itemsSource)
{
position++;
if (obj == sender)
break;
}
SetIndividualPoint(position, sender, true);
UpdateArea();
}
}
|
<chart:SfChart Grid.Row="1"
x:Name="chart" >
..
<local:BubbleSeriesExt XBindingPath="XValue" YBindingPath="YValue"
Size="ZValue" ListenPropertyChange="True"
ItemsSource="{Binding Data}"/>
</chart:SfChart> |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.