I am new to triggers concepts and I'm not able to get the right approach as to how to achieve it.
Based on data I have to scroll. Suppose data is cat
so in list I have to 'scroll to cat
'.
<ViewCell Height="80">
<StackLayout Orientation="Horizontal"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand">
<Label Text="{Binding Data}"
TextColor="White"
FontSize="45"
Margin="10,5,0,0"
HorizontalOptions="CenterAndExpand"
VerticalOptions="Center">
<Label.Triggers>
<DataTrigger TargetType="Label"
Binding="{Binding Data}"
Value="true">
<Setter Property="Text"
Value="{Binding Data}" />
</DataTrigger>
</Label.Triggers>
</Label>
</StackLayout>
</ViewCell>
Based on your comments... You want to scroll to specific item in your
ListView
. First thing you need to have is a reference to that specific object in yourItemSource
list, after that usingScrollTo
method you can scroll to that specific list item in yourListView
.You can try implement that like this:
More about
ListView.ScrollTo
you can find here.