-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
IndicatorsSampleMaximumVisible.xaml
57 lines (56 loc) · 3.2 KB
/
IndicatorsSampleMaximumVisible.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
54
55
56
57
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xamarin.Forms.Controls.IndicatorsSampleMaximumVisible">
<ContentPage.Resources>
<OnPlatform x:Key="IonicsFontFamily" x:TypeArguments="x:String">
<On Platform="iOS" Value="Ionicons" />
<On Platform="Android" Value="fonts/ionicons.ttf#" />
</OnPlatform>
<x:String x:Key="Indicator"></x:String>
</ContentPage.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<StackLayout Grid.Row="0">
<Label Text="When the MaximumVisible is set above the item count of the collection, the max item count should be visible instead of MaximumVisible"></Label>
<Label x:Name="CurrentCount"></Label>
</StackLayout>
<Button Grid.Row="1" Text="MaximumVisible--" Clicked="MaximumVisibleClicked"></Button>
<Button Grid.Row="2" Text="Set MaximumVisible> ItemCount" Clicked="MaximumVisibleAboveItemCountClicked"></Button>
<StackLayout HorizontalOptions="Center" Grid.Row="3" Orientation="Horizontal">
<Button Text="ItemsSource--" Clicked="ItemsSourceMinusClicked"></Button>
<Button Text="ItemsSource++" Clicked="ItemsSourcePlusClicked"></Button>
</StackLayout>
<CarouselView x:Name="carousel" ItemsSource="{Binding Items}" Grid.Row="5" Grid.RowSpan="3" IndicatorView="indicators">
<CarouselView.ItemTemplate>
<DataTemplate>
<Frame BackgroundColor="{Binding Color}">
<Grid HorizontalOptions="Center" VerticalOptions="Center">
<Label Text="{Binding Name}" FontSize="25"></Label>
</Grid>
</Frame>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
<IndicatorView x:Name="indicators" Grid.Row="6" IndicatorColor="Gray" SelectedIndicatorColor="White" HorizontalOptions="Center" />
<IndicatorView x:Name="indicatorsForms" Grid.Row="7" IndicatorColor="Gray"
ItemsSource="{Binding Path=ItemsSource, Source={x:Reference carousel}}"
Position="{Binding Path=Position, Source={x:Reference carousel}}"
SelectedIndicatorColor="White" HorizontalOptions="Center" >
<IndicatorView.IndicatorTemplate>
<DataTemplate>
<Label FontFamily="{StaticResource IonicsFontFamily}" Text="{StaticResource Indicator}"></Label>
</DataTemplate>
</IndicatorView.IndicatorTemplate>
</IndicatorView>
</Grid>
</ContentPage>