public class MainPageViewModel : BindableBase, INavigationAware
{
public Command<object> EditCommand { get; set; }
public MainPageViewModel()
{
EditCommand = new Command<object>(OnSwipeEdit);
}
private void OnSwipeEdit(object obj)
{
var swipedItem = obj as Contacts;
var newPage = new NewPage();
newPage.BindingContext = swipedItem;
OnResettingSwipeView(new ResetEventArgs());
App.Current.MainPage.Navigation.PushAsync(newPage);
}
} |
private void UpdateExpenseTapped(object obj)
{
var itemData = obj as ExpenseDetail;
var upsertPage = new UpsertExpense(true, 0, itemData.ID);
upsertPage.BindingContext = itemData;
upsertPage.BindingContext = new UpsertExpenseViewModel(true, 0, itemData.ID); // from UpsertExpense.xaml.cs
OnResettingSwipeView(new ResetEventArgs());
App.Current.MainPage.Navigation.PushAsync(upsertPage);
}
|