public void Animation(SfRotator rotator, double selectedIndex)
{
if ( rotator != null && rotator.ItemsSource != null && rotator.ItemsSource.Count() > 0 )
{
……
if ( Device.RuntimePlatform != Device.UWP )
{
var items = ( rotator.ItemsSource as IEnumerable<object> ).ToList();
// Start animation to selected view.
var currentItem = items[index];
var childElement = ( ( ( currentItem as Boarding ).RotatorItem as ContentView ).Children[0] as StackLayout ).Children.ToList();
if ( childElement != null && childElement.Count > 0 )
{
this.StartAnimation(childElement, currentItem as Boarding);
}
……… |
public void Animation(SfRotator rotator, double selectedIndex)
{
if ( rotator != null && rotator.ItemsSource != null && rotator.ItemsSource.Count() > 0 )
{
……
if ( Device.RuntimePlatform != Device.UWP )
{
……
// Start animation to selected view.
var currentItem = items[index];
var childElement = ( ( ( currentItem as Boarding ).RotatorItem as ContentView ).Children[0] as Grid ).Children.ToList();
if ( childElement != null && childElement.Count > 0 )
{
this.StartAnimation(childElement, currentItem as Boarding);
}
…
|
<Grid x:Name="slMain"
BackgroundColor="Transparent"
VerticalOptions="FillAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Label to display header -->
<Label Grid.Row="0" Grid.Column="0"
Margin="0,0,0,8"
TextColor="White"
HorizontalOptions="Center"
Opacity="{OnPlatform Default=0,UWP=1}"
Style="{StaticResource LabelStyle}"
Text="{Binding Header}"
TranslationY="{OnPlatform Default=10, UWP=0}" />
<!-- Image for display svg image -->
<Image Grid.Row="1" Grid.Column="0"
BackgroundColor="Transparent"
VerticalOptions="FillAndExpand"
Opacity="{OnPlatform Default=0, UWP=1}"
Source="{Binding ImagePath}"
HeightRequest="{core:OnPlatformOrientationDoubleValue Default=400,
AndroidPhonePortrait=300,
AndroidPhoneLandscape=140,
iOSPhonePortrait=300,
iOSPhoneLandscape=240}"
WidthRequest="{x:OnIdiom Phone=200,
Desktop=300,
Tablet=300}" />
<!-- Label to display content -->
<Label Grid.Row="2" Grid.Column="0"
TextColor="White" BackgroundColor="Yellow"
HorizontalOptions="Center"
Opacity="{OnPlatform Default=0, UWP=1}"
Style="{StaticResource LabelStyle}"
Text="{Binding Content}"
TranslationY="{OnPlatform Default=60, UWP=0}" />
</Grid> |
<Label Grid.Row="0"
FontFamily="{StaticResource Montserrat-SemiBold}"
FontSize="14"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
Opacity="{OnPlatform Default=0,
UWP=1}"
Style="{StaticResource LabelStyle}"
Text="{Binding Header}"
TranslationY="{OnPlatform Default=60,
UWP=0}"
VerticalTextAlignment="Center" /> |