Hi Dinesh,
Thank you, your solution is working well.
Here is my implementation:
Xaml:
<rotator:SfRotator EnableLooping="false"
NavigationStripMode="Dots"
DotPlacement="None"
VerticalOptions="FillAndExpand"
SelectedIndex="{Binding WizardIndex, Mode=TwoWay}"
ItemsSource="{Binding WizardTemplates}"
ItemTemplate="{StaticResource WizardItemTemplate}">
<rotator:SfRotator.Behaviors>
<behavior:EventToCommandBehavior EventName="SelectedIndexChanged"
Converter="{StaticResource SelectedIndexChangedConverter}"
Command="{Binding WizardSelectedIndexChangedCommand}" />
</rotator:SfRotator.Behaviors>
</rotator:SfRotator>
<listView:SfListView Orientation="Horizontal"
HeightRequest="100"
Padding="2"
ItemSpacing="2"
ItemSize="100"
IsScrollBarVisible="False"
IsStickyFooter="True"
IsStickyHeader="True"
ItemsSource="{Binding SelectorThumbnails}"
TapCommand="{Binding SelectorItemTappedCommand}"
SelectedItem="{Binding SelectorSelectedItem}">
<listView:SfListView.Behaviors>
<local:SelectorListViewBehavior />
</listView:SfListView.Behaviors>
<listView:SfListView.ItemTemplate>
<DataTemplate>
<StackLayout VerticalOptions="FillAndExpand"
BackgroundColor="{StaticResource ButtonColor}">
<Image Source="{Binding Image}" />
<Label FontSize="10"
Text="{Binding Text}" />
</StackLayout>
</DataTemplate>
</listView:SfListView.ItemTemplate>
<listView:SfListView.SelectedItemTemplate>
<DataTemplate>
<StackLayout VerticalOptions="FillAndExpand"
BackgroundColor="LightBlue">
<Image Source="{Binding Image}" />
<Label FontSize="10"
Text="{Binding Text}" />
</StackLayout>
</DataTemplate>
</listView:SfListView.SelectedItemTemplate>
<listView:SfListView.HeaderTemplate>
<DataTemplate>
<StackLayout BackgroundColor="White"
IsVisible="{Binding SelectorScrollLeftIsVisible}">
<button:SfButton HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand"
Command="{Binding SelectorScrollLeftTappedCommand}">
<button:SfButton.Content>
<iconize:IconLabel Text="far-arrow-alt-circle-left"
FontSize="35" />
</button:SfButton.Content>
</button:SfButton>
</StackLayout>
</DataTemplate>
</listView:SfListView.HeaderTemplate>
<listView:SfListView.FooterTemplate>
<DataTemplate>
<StackLayout BackgroundColor="White"
IsVisible="{Binding SelectorScrollRightIsVisible}">
<button:SfButton HorizontalOptions="CenterAndExpand"
VerticalOptions="CenterAndExpand"
Command="{Binding SelectorScrollRightTappedCommand}">
<button:SfButton.Content>
<iconize:IconLabel Text="far-arrow-alt-circle-right"
FontSize="35" />
</button:SfButton.Content>
</button:SfButton>
</StackLayout>
</DataTemplate>
</listView:SfListView.FooterTemplate>
</listView:SfListView>
SelectorListViewBehavior.cs:
public class SelectorListViewBehavior : Behavior<SfListView>
{
private WizardPopUpViewModel _viewModel;
private SfListView _listView;
protected override void OnAttachedTo(SfListView listView)
{
_listView = listView;
listView.Loaded += OnListViewLoaded;
base.OnAttachedTo(listView);
}
protected override void OnDetachingFrom(SfListView listView)
{
listView.Loaded -= OnListViewLoaded;
_viewModel.PropertyChanged -= ViewModelPropertyChanged;
_viewModel = null;
_listView = null;
base.OnDetachingFrom(listView);
}
private void OnListViewLoaded(object sender, ListViewLoadedEventArgs eventArgs)
{
_viewModel = _listView.BindingContext as WizardPopUpViewModel;
_viewModel.PropertyChanged += ViewModelPropertyChanged;
}
private void ViewModelPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs eventArgs)
{
if (eventArgs.PropertyName == "WizardIndex")
{
_listView.LayoutManager.ScrollToRowIndex(_viewModel.WizardIndex,
Syncfusion.ListView.XForms.ScrollToPosition.MakeVisible, false);
}
}
}
Thanks
Mark.