Hello,
I have the same problem : https://stackoverflow.com/questions/54657758/how-to-set-the-currentpage-property-of-a-tabbedpage-in-the-oncurrentpagechanged
If I change the CurrentPage in OnCurrentPageChanged, I have an infinite loop. My client want a previous and next tab button...
They button change MVVM selected Item and I want to go back in the Children[1] (<- the loop)
protected override void OnCurrentPageChanged()
{
base.OnCurrentPageChanged();
if((this.CurrentPage == this.Children.First() || this.CurrentPage == this.Children.Last()) && !init_page)
{
this.view_model.CurrentItem = this.CurrentPage == this.Children.First() ? this.view_model.PreviousItem : this.view_model.NextItem;
this.SelectedItem = this.Children[1]; // Boucle infinie
}
}
- Last Tab call OnCurrentPageChanged
- this.Children[1] call OnCurrentPageChanged
- Last Tab call OnCurrentPageChanged
- this.Children[1] call OnCurrentPageChanged
- ...
Thanks