|
| 1 | +<?xml version="1.0" encoding="utf-8" ?> |
| 2 | +<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" |
| 4 | + x:Class="TabViewHeaderItemTemplate.MainPage" |
| 5 | + xmlns:local="clr-namespace:TabViewHeaderItemTemplate" |
| 6 | + xmlns:tabView="clr-namespace:Syncfusion.Maui.TabView;assembly=Syncfusion.Maui.TabView" |
| 7 | + WidthRequest="{OnPlatform WinUI='300'}"> |
| 8 | + <ContentPage.BindingContext> |
| 9 | + <local:ViewModel/> |
| 10 | + </ContentPage.BindingContext> |
| 11 | + |
| 12 | + <ContentPage.Content> |
| 13 | + <tabView:SfTabView x:Name="tabView" ItemsSource="{Binding TabHeaderCollection}" |
| 14 | + TabBarBackground="HotPink" > |
| 15 | + <tabView:SfTabView.HeaderItemTemplate> |
| 16 | + <DataTemplate> |
| 17 | + <HorizontalStackLayout Spacing="2"> |
| 18 | + <Label FontAttributes="Bold" |
| 19 | + WidthRequest="70" |
| 20 | + HorizontalTextAlignment="Center" |
| 21 | + VerticalTextAlignment="Center" |
| 22 | + Text="{Binding Name}"/> |
| 23 | + </HorizontalStackLayout> |
| 24 | + </DataTemplate> |
| 25 | + </tabView:SfTabView.HeaderItemTemplate> |
| 26 | + |
| 27 | + <tabView:SfTabView.Items> |
| 28 | + <tabView:SfTabItem > |
| 29 | + <tabView:SfTabItem.Content> |
| 30 | + <ListView RowHeight="50"> |
| 31 | + <ListView.ItemsSource> |
| 32 | + <x:Array Type="{x:Type x:String}"> |
| 33 | + <x:String>James</x:String> |
| 34 | + <x:String>Richard</x:String> |
| 35 | + <x:String>Michael</x:String> |
| 36 | + <x:String>Alex</x:String> |
| 37 | + <x:String>Clara</x:String> |
| 38 | + </x:Array> |
| 39 | + </ListView.ItemsSource> |
| 40 | + <ListView.ItemTemplate> |
| 41 | + <DataTemplate> |
| 42 | + <ViewCell> |
| 43 | + <Grid Margin="10,5"> |
| 44 | + <Label VerticalOptions="Start" |
| 45 | + HorizontalOptions="Start" |
| 46 | + TextColor="#666666" |
| 47 | + FontSize="16" |
| 48 | + Text="{Binding}" /> |
| 49 | + </Grid> |
| 50 | + </ViewCell> |
| 51 | + </DataTemplate> |
| 52 | + </ListView.ItemTemplate> |
| 53 | + </ListView> |
| 54 | + </tabView:SfTabItem.Content> |
| 55 | + </tabView:SfTabItem> |
| 56 | + |
| 57 | + <tabView:SfTabItem > |
| 58 | + <tabView:SfTabItem.Content> |
| 59 | + <ScrollView > |
| 60 | + <StackLayout Spacing="20" > |
| 61 | + <ListView RowHeight="50"> |
| 62 | + <ListView.ItemsSource> |
| 63 | + <x:Array Type="{x:Type x:String}"> |
| 64 | + <x:String>Steve</x:String> |
| 65 | + <x:String>Mark</x:String> |
| 66 | + <x:String>Alan</x:String> |
| 67 | + <x:String>Sandra</x:String> |
| 68 | + <x:String>Ryan</x:String> |
| 69 | + </x:Array> |
| 70 | + </ListView.ItemsSource> |
| 71 | + <ListView.ItemTemplate> |
| 72 | + <DataTemplate> |
| 73 | + <ViewCell> |
| 74 | + <Grid Margin="10,5"> |
| 75 | + <Label VerticalOptions="Start" |
| 76 | + HorizontalOptions="Start" |
| 77 | + TextColor="#666666" |
| 78 | + FontSize="16" |
| 79 | + Text="{Binding}" /> |
| 80 | + </Grid> |
| 81 | + </ViewCell> |
| 82 | + </DataTemplate> |
| 83 | + </ListView.ItemTemplate> |
| 84 | + </ListView> |
| 85 | + |
| 86 | + </StackLayout> |
| 87 | + </ScrollView> |
| 88 | + </tabView:SfTabItem.Content> |
| 89 | + </tabView:SfTabItem> |
| 90 | + |
| 91 | + <tabView:SfTabItem > |
| 92 | + <tabView:SfTabItem.Content> |
| 93 | + <ListView RowHeight="50"> |
| 94 | + <ListView.ItemsSource> |
| 95 | + <x:Array Type="{x:Type x:String}"> |
| 96 | + <x:String>Sandra</x:String> |
| 97 | + <x:String>Ryan</x:String> |
| 98 | + <x:String>Michael</x:String> |
| 99 | + <x:String>Mark</x:String> |
| 100 | + <x:String>Clara</x:String> |
| 101 | + </x:Array> |
| 102 | + </ListView.ItemsSource> |
| 103 | + <ListView.ItemTemplate> |
| 104 | + <DataTemplate> |
| 105 | + <ViewCell> |
| 106 | + <Grid Margin="10,5"> |
| 107 | + <Label VerticalOptions="Start" |
| 108 | + HorizontalOptions="Start" |
| 109 | + TextColor="#666666" |
| 110 | + FontSize="16" |
| 111 | + Text="{Binding}" /> |
| 112 | + </Grid> |
| 113 | + </ViewCell> |
| 114 | + </DataTemplate> |
| 115 | + </ListView.ItemTemplate> |
| 116 | + </ListView> |
| 117 | + </tabView:SfTabItem.Content> |
| 118 | + </tabView:SfTabItem> |
| 119 | + <tabView:SfTabItem x:Name="more"> |
| 120 | + <tabView:SfTabItem.Content> |
| 121 | + <Grid BackgroundColor="Red"/> |
| 122 | + </tabView:SfTabItem.Content> |
| 123 | + </tabView:SfTabItem> |
| 124 | + <tabView:SfTabItem x:Name="help"> |
| 125 | + <tabView:SfTabItem.Content> |
| 126 | + <Grid BackgroundColor="Green"/> |
| 127 | + </tabView:SfTabItem.Content> |
| 128 | + </tabView:SfTabItem> |
| 129 | + <tabView:SfTabItem x:Name="info"> |
| 130 | + <tabView:SfTabItem.Content> |
| 131 | + <Grid BackgroundColor="LightBlue"/> |
| 132 | + </tabView:SfTabItem.Content> |
| 133 | + </tabView:SfTabItem> |
| 134 | + <tabView:SfTabItem x:Name="about"> |
| 135 | + <tabView:SfTabItem.Content> |
| 136 | + <Grid BackgroundColor="Beige"/> |
| 137 | + </tabView:SfTabItem.Content> |
| 138 | + </tabView:SfTabItem> |
| 139 | + <tabView:SfTabItem x:Name="settings"> |
| 140 | + <tabView:SfTabItem.Content> |
| 141 | + <Grid BackgroundColor="MistyRose"/> |
| 142 | + </tabView:SfTabItem.Content> |
| 143 | + </tabView:SfTabItem> |
| 144 | + </tabView:SfTabView.Items> |
| 145 | + </tabView:SfTabView> |
| 146 | + </ContentPage.Content> |
| 147 | + |
| 148 | +</ContentPage> |
0 commit comments