Esempio n. 1
0
		private void Commit()
		{
			var composer = new LiteComposer { Title = "Commit Message" };
			var vm = (EditSourceViewModel)this.ViewModel;
			composer.Text = "Update " + vm.Path.Substring(vm.Path.LastIndexOf('/') + 1);
            var text = _composerView.Text;
            composer.ReturnAction += (s, e) => CommitThis(vm, composer, text, e);
			_composerView.TextView.BecomeFirstResponder ();
			NavigationController.PushViewController(composer, true);
		}
Esempio n. 2
0
 /// <summary>
 /// Need another function because Xamarin generates an Invalid IL if used inline above
 /// </summary>
 private async Task CommitThis(EditSourceViewModel viewModel, LiteComposer composer, string content, string message)
 {
     try
     {
         await this.DoWorkAsync("Commiting...", () => viewModel.Commit(content, message));
         NavigationController.DismissViewController(true, null);
     }
     catch (Exception ex)
     {
         MonoTouch.Utilities.ShowAlert("Error", ex.Message);
         composer.EnableSendButton = true;
     }
 }