I extended the class to solve the issue #23 by using a custom BindableObject. But when I update the position the event PositionChanged gets called multiple times.
private void IndexChanged(object sender, PositionChangedEventArgs e)
{
// gets called with values: old=0 new=1, old=1 new=0, old=0 new=1.
// some times twice other times three times.
if (this.CurrentIndex == e.NewPosition) return;
userChange = true;
this.CurrentIndex = e.NewPosition;
}
private static void CurrentIndexPropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
var control = bindable as TabViewControlExtended;
if (control == null || control.userChange == true) return;
if (control?.SelectedTabIndex == (int)newValue) return;
control.userChange = false;
control.SelectedTabIndex = (int)newValue; // by changins the atribute
//control?.SetPosition((int)newValue); // and also by using this metod
}
I extended the class to solve the issue #23 by using a custom
BindableObject
. But when I update the position the eventPositionChanged
gets called multiple times.