forked from dotnet/maui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainPage.xaml
More file actions
74 lines (68 loc) · 2.78 KB
/
Copy pathMainPage.xaml
File metadata and controls
74 lines (68 loc) · 2.78 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.MainPage"
xmlns:local="clr-namespace:Maui.Controls.Sample">
<Grid Padding="20" RowSpacing="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="400"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Title -->
<Label Grid.Row="0"
Text="Vertical CarouselView Centering Test"
FontSize="18"
FontAttributes="Bold"
HorizontalOptions="Center"/>
<!-- Handler info -->
<Label x:Name="HandlerLabel"
Grid.Row="1"
Text="Handler: Unknown"
FontSize="14"
HorizontalOptions="Center"/>
<!-- CarouselView with Vertical Orientation -->
<CarouselView x:Name="TestCarouselView"
Grid.Row="2"
BackgroundColor="LightGray"
Loop="True">
<CarouselView.ItemsLayout>
<LinearItemsLayout Orientation="Vertical"/>
</CarouselView.ItemsLayout>
<CarouselView.ItemTemplate>
<DataTemplate>
<Grid BackgroundColor="LightBlue" Padding="20">
<Label Text="{Binding}"
FontSize="24"
FontAttributes="Bold"
HorizontalOptions="Center"
VerticalOptions="Center"/>
</Grid>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
<!-- Current Item Display -->
<Label x:Name="CurrentItemLabel"
AutomationId="CurrentItemLabel"
Grid.Row="3"
Text="CurrentItem: (waiting...)"
FontSize="16"
FontAttributes="Bold"
HorizontalOptions="Center"/>
<!-- Instructions -->
<Label Grid.Row="4"
Text="Loop=True - Test scrolling past last item"
FontSize="12"
HorizontalOptions="Center"
TextColor="Gray"/>
<!-- Scroll Button -->
<Button x:Name="ScrollButton"
AutomationId="ScrollButton"
Grid.Row="5"
Text="Scroll to Next Item"
Clicked="OnScrollButtonClicked"
HorizontalOptions="Center"/>
</Grid>
</ContentPage>