-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainPage.xaml
50 lines (48 loc) · 2.17 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
<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:local="clr-namespace:TabPage_GenerateItems"
x:Class="TabPage_GenerateItems.MainPage"
>
<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>
<Label
x:Name="label"
Margin="16,48,16,16"
HorizontalOptions="Center"
VerticalOptions="Center"
TextColor="{Binding IsSelected, Converter={StaticResource boolToColorConverter}}"
Text="{Binding BrandName}"
HorizontalTextAlignment="Center"
Padding="5,0"/>
</DataTemplate>
</dx:TabView.ItemHeaderTemplate>
<dx:TabView.ItemTemplate>
<DataTemplate>
<CollectionView ItemsSource="{Binding CarModels}">
<CollectionView.ItemTemplate>
<DataTemplate>
<Label Padding="5" Text="{Binding FullName}" />
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</DataTemplate>
</dx:TabView.ItemTemplate>
</dx:TabView>
</ContentPage>