TabPage.ItemsSource Property
Gets or sets the collection used to generate the TabPage’s tab items.
Namespace: DevExpress.XamarinForms.Navigation
Assembly: DevExpress.XamarinForms.Navigation.dll
NuGet Package: DevExpress.XamarinForms.Navigation
#Declaration
public IEnumerable ItemsSource { get; set; }
#Property Value
Type | Description |
---|---|
IEnumerable | The collection used to generate the Tab |
#Example
The following example demonstrates how to generate items for a TabPage from a data source:
Note
The topic Populate Tab Items from a Data Source contains the complete example.
<dxn:TabPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:TabPageExample_ItemsSource"
xmlns:dxn="http://schemas.devexpress.com/xamarin/2014/forms/navigation"
xmlns:viewmodels="clr-namespace:TabPageExample_ItemsSource.ViewModels"
x:Class="TabPageExample_ItemsSource.MainPage"
ItemsSource="{Binding VehiclesByMake}"
SelectedItemIndex="{Binding SelectedIndex, Mode=TwoWay}">
<dxn:TabPage.BindingContext>
<viewmodels:MainViewModel/>
</dxn:TabPage.BindingContext>
<dxn:TabPage.ItemHeaderTemplate>
<DataTemplate>
<Label Text="{Binding GroupKey}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"/>
</DataTemplate>
</dxn:TabPage.ItemHeaderTemplate>
<dxn:TabPage.ItemTemplate>
<DataTemplate>
<ContentPage>
<ListView ItemsSource="{Binding Vehicles}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding FullName}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
</DataTemplate>
</dxn:TabPage.ItemTemplate>
</dxn:TabPage>
The table below lists properties the markup above utilizes:
Property | Description |
---|---|
| Gets or sets the collection used to generate the Tab |
Gets or sets the template the Tab | |
Gets or sets the template the Tab |