Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit adef222

Browse files
committed
Added IndicatorSize support.
1 parent b5c660c commit adef222

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

UserInterface/IndicatorViewDemos/IndicatorViewDemos/Views/ConfigurableIndicatorViewPage.xaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<RowDefinition Height="Auto" />
1717
<RowDefinition Height="Auto" />
1818
<RowDefinition Height="Auto" />
19+
<RowDefinition Height="Auto" />
1920
</Grid.RowDefinitions>
2021
<Grid.ColumnDefinitions>
2122
<ColumnDefinition Width="0.5*" />
@@ -64,7 +65,24 @@
6465
</x:Array>
6566
</Picker.ItemsSource>
6667
</Picker>
67-
<CarouselView Grid.Row="4"
68+
<Label Grid.Row="4"
69+
Text="IndicatorSize:"
70+
VerticalTextAlignment="Center"
71+
HorizontalOptions="End" />
72+
<Picker x:Name="indicatorSizePicker"
73+
Grid.Row="4"
74+
Grid.Column="1"
75+
HorizontalOptions="Start"
76+
SelectedIndexChanged="OnIndicatorSizeChanged">
77+
<Picker.ItemsSource>
78+
<x:Array Type="{x:Type x:String}">
79+
<x:String>6</x:String>
80+
<x:String>12</x:String>
81+
<x:String>18</x:String>
82+
</x:Array>
83+
</Picker.ItemsSource>
84+
</Picker>
85+
<CarouselView Grid.Row="5"
6886
Grid.ColumnSpan="2"
6987
ItemsSource="{Binding Monkeys}"
7088
IndicatorView="indicatorView">
@@ -74,7 +92,7 @@
7492
<Frame HasShadow="True"
7593
BorderColor="DarkGray"
7694
CornerRadius="5"
77-
Margin="50"
95+
Margin="10"
7896
HeightRequest="300"
7997
HorizontalOptions="Center"
8098
VerticalOptions="CenterAndExpand">
@@ -103,7 +121,7 @@
103121
</CarouselView.ItemTemplate>
104122
</CarouselView>
105123
<IndicatorView x:Name="indicatorView"
106-
Grid.Row="5"
124+
Grid.Row="6"
107125
Grid.ColumnSpan="2"
108126
Margin="0,0,0,40"
109127
HorizontalOptions="Center" />

UserInterface/IndicatorViewDemos/IndicatorViewDemos/Views/ConfigurableIndicatorViewPage.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ void PopulateColorPickers()
2828
selectedIndicatorColorPicker.ItemsSource = colors;
2929
selectedIndicatorColorPicker.SelectedIndex = 2;
3030
maximumVisbilePicker.SelectedIndex = 0;
31+
indicatorSizePicker.SelectedIndex = 0;
3132
}
3233

3334
void OnIndicatorColorChanged(object sender, EventArgs e)
@@ -57,5 +58,10 @@ void OnMaximumVisibleChanged(object sender, EventArgs e)
5758
{
5859
indicatorView.MaximumVisible = Convert.ToInt32((sender as Picker).SelectedItem);
5960
}
61+
62+
void OnIndicatorSizeChanged(object sender, EventArgs e)
63+
{
64+
indicatorView.IndicatorSize = Convert.ToDouble((sender as Picker).SelectedItem);
65+
}
6066
}
6167
}

0 commit comments

Comments
 (0)