protected override async void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			
			string taskID = Intent.GetStringExtra("TaskID") ?? string.Empty;
			if(!string.IsNullOrEmpty(taskID)) {
				var getResponse = await TodoManager.GetTodo(taskID);
				task = getResponse.Success.FirstOrDefault().Value;
			}
			
			// set our layout to be the home screen
			SetContentView(Resource.Layout.TaskDetails);
			nameTextEdit = FindViewById<EditText>(Resource.Id.NameText);
			notesTextEdit = FindViewById<EditText>(Resource.Id.NotesText);
			saveButton = FindViewById<Button>(Resource.Id.SaveButton);
			
			// find all our controls
			cancelDeleteButton = FindViewById<Button>(Resource.Id.CancelDeleteButton);
			
			// set the cancel delete based on whether or not it's an existing task
			cancelDeleteButton.Text = "Delete";
			
			nameTextEdit.Text = task.Name; 
			notesTextEdit.Text = task.Notes;

			// button clicks 
			cancelDeleteButton.Click += (sender, e) => { CancelDelete(); };
			saveButton.Click += (sender, e) => { Save(); };
		}
예제 #2
0
		protected void ShowTaskDetails(Todo task)
		{
			currentTask = task;
			taskDialog = new TaskDialog (task);
			context = new BindingContext (this, taskDialog, "Task Details");
			detailsScreen = new DialogViewController (context.Root, true);
			ActivateController(detailsScreen);
		}
예제 #3
0
 public static Task<CMObjectResponse> SaveTodo(Todo item)
 {
     return appObjectService.SetObject<Todo> (item);
 }
예제 #4
0
 public TaskDialog(Todo task)
 {
     Name = task.Name;
     Notes = task.Notes;
 }
예제 #5
0
 public static Task<CMObjectResponse> SaveTodo(Todo item)
 {
     return TodoService.SaveTodo(item);
 }