Пример #1
0
 public void Update (Task item)
 {
     ID = item.ID;
     Name = item.Name;
     Notes = item.Notes;
     Done = item.Done;
 }
Пример #2
0
		protected void ShowTaskDetails (Task task)
		{
			currentTask = task;
			taskDialog = new TaskDialog (task);
			
			var title = Foundation.NSBundle.MainBundle.LocalizedString ("Task Details", "Task Details");
			context = new LocalizableBindingContext (this, taskDialog, title);
			detailsScreen = new DialogViewController (context.Root, true);
			ActivateController(detailsScreen);
		}
Пример #3
0
		/// <summary>
		/// Insert or update a task
		/// </summary>
		public int SaveTask (Task item)
		{ 
			var max = 0;
			if (tasks.Count > 0) 
				max = tasks.Max(x => x.ID);

			if (item.ID == 0) {
				item.ID = ++max;
				tasks.Add (item);
			} else {
				//HACK: why isn't Find available in PCL ?
				//var i = tasks.Find (x => x.ID == item.ID); 
				var j = tasks.Where (x => x.ID == item.ID).First();
				j = item; // replaces item in collection with updated value
			}

			storage.WriteXml (tasks, storeLocation);
			return max;
		}
Пример #4
0
 public TaskViewModel (Task item)
 {
     Update (item);
 }
Пример #5
0
		public int SaveTask (Task item)
		{
			return repository.SaveTask(item);
		}