-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMainPage.xaml
53 lines (52 loc) · 2.42 KB
/
MainPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:dx="http://schemas.devexpress.com/maui"
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
xmlns:local="clr-namespace:TabView_GenerateItems"
x:Class="TabView_GenerateItems.MainPage"
ios:Page.UseSafeArea="true">
<ContentPage.Resources>
<local:BoolToColorConverter x:Key="boolToColorConverter" TrueSource="White" FalseSource="#90FFFFFF"/>
</ContentPage.Resources>
<ContentPage.BindingContext>
<local:MainViewModel/>
</ContentPage.BindingContext>
<dx:TabView ItemsSource="{Binding CarModelsByBrand}"
SelectedItemIndex="{Binding SelectedIndex, Mode=TwoWay}"
ItemHeaderMinWidth="90"
ItemHeaderMaxWidth="360"
HeaderPanelItemSpacing="8"
HeaderPanelBackgroundColor="#1e88e5"
HeaderPanelShadowHeight="3"
HeaderPanelShadowRadius="3"
IsSelectedItemIndicatorVisible="True"
SelectedItemIndicatorColor="White">
<dx:TabView.ItemHeaderTemplate>
<DataTemplate>
<AbsoluteLayout>
<Label AbsoluteLayout.LayoutBounds="0.5, 0.5"
AbsoluteLayout.LayoutFlags="PositionProportional"
Text="{Binding BrandName}"
HorizontalTextAlignment="Center"
Padding="5,0"
TextColor="{Binding IsSelected, Converter={StaticResource boolToColorConverter}}"/>
</AbsoluteLayout>
</DataTemplate>
</dx:TabView.ItemHeaderTemplate>
<dx:TabView.ItemTemplate>
<DataTemplate>
<Grid>
<ListView ItemsSource="{Binding CarModels}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Label Padding="5" Text="{Binding FullName}" />
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</DataTemplate>
</dx:TabView.ItemTemplate>
</dx:TabView>
</ContentPage>