I have a menu that looks like this:
<ListView x:Name="listView" ItemsSource="{Binding MenuItems}" x:FieldModifier="public" Margin="5" HasUnevenRows="True" SeparatorVisibility="None" BackgroundColor="Transparent">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Frame HorizontalOptions="CenterAndExpand" BackgroundColor="#939598" Padding="5" Margin="5" WidthRequest="254">
<Grid Padding="2" RowSpacing="2" ColumnSpacing="2" Margin="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="34" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Source="{Binding IconSource}" Aspect="AspectFill" />
<Label Grid.Column="1" Text="{Binding Title}" FontAttributes="Bold" FontSize="Medium" TextColor="#D7D8D9" />
</Grid>
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Items are added to the menu programmatically:
string[] areas = AreaNames.Split(',');
for (int i = 0; i < areas.Length; i++)
MenuItems.Add(new MasterPageItem { Title = areas[i], IconSource = "vehiclelist.png", TargetType = typeof(VehiclesListPage) });
This works, but when a VehiclesListPage is created, I have no idea which area the user has selected. How do I know what area is selected?