void SaveClicked(object sender, System.EventArgs e)
 {
     if (itemTypesViewModel.rootViewModel.IsEdit)
     {
         itemTypesViewModel.rootViewModel.IsEdit = false;
         itemTypesViewModel.UpdateItem(mediaFile);
     }
     else
     {
         itemTypesViewModel.SaveNewItem(mediaFile);
     }
 }
コード例 #2
0
        async void Save_Clicked(object sender, EventArgs e)
        {
            if (ButtonIsBusy)
            {
                return;
            }
            ButtonIsBusy = true;

            if (EditMode)
            {
                NewItemViewModel.SaveEditedItem();
                // remove old ItemDetailPage from navigation stack.
                Navigation.RemovePage(Navigation.NavigationStack[Navigation.NavigationStack.Count - 2]);
            }
            else
            {
                NewItemViewModel.SaveNewItem();
            }

            await Navigation.PopAsync();
        }