toptabbedpage-xamarin-forms
toptabbedpage-xamarin-forms copied to clipboard
System.ArgumentOutOfRangeException
Steps: 1- Install-Package Naxam.TopTabbedPage.Forms 2-create page with binding source
<?xml version="1.0" encoding="utf-8"?>
<forms:TopTabbedPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TestTabs.MainPage"
xmlns:views="clr-namespace:TestTabs"
xmlns:forms="clr-namespace:Naxam.Controls.Forms;assembly=Naxam.TopTabbedPage.Forms"
BarTextColor="#00b9e1"
BarIndicatorColor="#00b9e1"
BarBackgroundColor="#ffffff"
ItemsSource="{Binding DashboardChildModels}"
Title="MyRide">
<forms:TopTabbedPage.ItemTemplate>
<DataTemplate>
<views:ChildPage Title="title"/>
</DataTemplate>
</forms:TopTabbedPage.ItemTemplate>
</forms:TopTabbedPage>
3- leave the collection empty
public class DashViewModel
{
public DashViewModel()
{
DashboardChildModels = new ObservableCollection<ChildPage>();
}
private ObservableCollection<ChildPage> _dashboardChildModels;
public ObservableCollection<ChildPage> DashboardChildModels
{
get
{
return _dashboardChildModels;
}
set { _dashboardChildModels = value; }
}
}
Expected behavior : App run and display no tabs
Actual behavior : App crash
Exception message :
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at System.Array.InternalArray__get_Item[T] (System.Int32 index) [0x00009] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/corlib/System/Array.cs:190
at at (wrapper managed-to-managed) UIKit.UIViewController[].System.Collections.Generic.IList`1.get_Item(int)
at Naxam.Controls.Platform.iOS.TopTabbedRenderer.ViewDidLoad () [0x00141] in <1f6b2b7c8f6c4ec4b46e787d64141cd6>:0
at at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper(intptr,intptr)
at UIKit.UIViewController.get_View () [0x0002a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/UIViewController.g.cs:3171
at Naxam.Controls.Platform.iOS.TopTabbedRenderer.get_NativeView () [0x00000] in <1f6b2b7c8f6c4ec4b46e787d64141cd6>:0
at Naxam.Controls.Platform.iOS.TopTabbedRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00059] in <1f6b2b7c8f6c4ec4b46e787d64141cd6>:0
at Xamarin.Forms.Platform.iOS.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x00014] in