コード例 #1
0
		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);
 }