Hello,
I’m using Xamarin Forms and building MVVM based application. I want my ViewModel to take care of number and type of series in chart, so I am trying to bind item source:
this.OneWayBind(ViewModel, vm => vm.CheckInData, v => v.series.ItemsSource).DisposeWith(disposable);
where CheckInData is defined in ViewModel:
public ObservableCollection CheckInData { get; set; }
HistoryСhart:
public class HistoryСhart : INotifyPropertyChanged
{
private string _days;
public string Days
{
get { return _days; }
set { _days = value; NotifyPropertyChanged(); }
}
private double _height;
public double Height
{
get { return _height; }
set { _height = value; NotifyPropertyChanged(); }
}
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged([CallerMemberName] String propertyName = “”)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
and when I change CheckInData:
CheckInData [0] = new HistoryShart { Days = “SQ”, Height = 10 };
The new data is recorded, but not drawn, but if I flip the device screen, the new data is drawn.
I’m using xamarin forms 2.5.0.280555 and Syncfusion.Xamarin.SfChart 16.1.0.37