Если вы используете Mvvm, вы можете перенести модель по нажатию кнопки.
Вы можете использовать эту команду для ее достижения.
<Button Grid.Column="2" Text="More" VerticalOptions="StartAndExpand" Command="{ Binding BindingContext.GetIdCommand, Source={x:Reference Name=BillView} }" CommandParameter="{Binding .}" />
Вот код макета.
<StackLayout Padding="10">
<Label x:Name="header" FontSize="25" Text="Invoices"
HorizontalOptions="Center" VerticalOptions="CenterAndExpand"
/>
<ListView x:Name="BillView" ItemsSource="{Binding Bills}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid>
<Label YAlign="Center" x:Name="MyInvoiceNumber" XAlign="Center" Grid.Column="0" Text="{Binding InvoiceNumber}" />
<Label YAlign="Center" XAlign="Center" Grid.Column="1" Text="{Binding InvoiceDate}" />
<Button Grid.Column="2" Text="More" VerticalOptions="StartAndExpand" Command="{ Binding BindingContext.GetIdCommand, Source={x:Reference Name=BillView} }" CommandParameter="{Binding .}" />
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
Вот код фона макета.
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
BindingContext = new MyBillViewModel(Navigation);
}
}
Вот MyBillViewModel
.
public class MyBillViewModel
{
public ICommand GetIdCommand { protected set; get; }
public ObservableCollection<Bill> Bills { get; set; }
public INavigation Navigation { get; set; }
public MyBillViewModel(INavigation navigation)
{
this.Navigation = navigation;
Bills = new ObservableCollection<Bill>();
Bills.Add(new Bill { InvoiceDate = "2020/2/23", InvoiceNumber = "1" });
Bills.Add(new Bill { InvoiceDate = "2020/2/23", InvoiceNumber = "2" });
Bills.Add(new Bill { InvoiceDate = "2020/2/23", InvoiceNumber = "3" });
Bills.Add(new Bill { InvoiceDate = "2020/2/23", InvoiceNumber = "4" });
Bills.Add(new Bill { InvoiceDate = "2020/2/23", InvoiceNumber = "5" });
Bills.Add(new Bill { InvoiceDate = "2020/2/23", InvoiceNumber = "6" });
Bills.Add(new Bill { InvoiceDate = "2020/2/23", InvoiceNumber = "7" });
GetIdCommand = new Command<Bill>(async (key) => {
Bill bill=(Bill)key;
await Navigation.PushAsync(new Page2(bill));
});
}
}
Вот режим Bill
.
public class Bill
{
public string InvoiceNumber { get; set; }
public string InvoiceDate { get; set; }
}
Вот мой бегущий GIF.

Я обновляю свое демо на github, вы можете обратиться к нему.
https://github.com/851265601/FormsListviewCommand