コード例 #1
0
 public void Update (TaskItem item)
 {
     ID = item.ID;
     Name = item.Name;
     Notes = item.Notes;
     Done = item.Done;
 }
コード例 #2
0
		protected void ShowTaskDetails (TaskItem taskItem)
		{
			currentTaskItem = taskItem;
			taskItemDialog = new TaskDialog (taskItem);
			
			var title = Foundation.NSBundle.MainBundle.LocalizedString ("Task Details", "Task Details");
			context = new LocalizableBindingContext (this, taskItemDialog, title);
			detailsScreen = new DialogViewController (context.Root, true);
			ActivateController(detailsScreen);
		}
コード例 #3
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			
			View titleView = Window.FindViewById(Android.Resource.Id.Title);
			if (titleView != null) {
			  IViewParent parent = titleView.Parent;
			  if (parent != null && (parent is View)) {
			    View parentView = (View)parent;
			    parentView.SetBackgroundColor(Color.Rgb(0x26, 0x75 ,0xFF)); //38, 117 ,255
			  }
			}

			int taskID = Intent.GetIntExtra("TaskID", 0);
			if(taskID > 0) {
				taskItem = Tasky.BL.Managers.TaskItemManager.GetTask(taskID);
			}
			
			// set our layout to be the home screen
			SetContentView(Resource.Layout.TaskDetails);
			nameTextEdit = FindViewById<EditText>(Resource.Id.txtName);
			notesTextEdit = FindViewById<EditText>(Resource.Id.txtNotes);
			saveButton = FindViewById<Button>(Resource.Id.btnSave);
			doneCheckbox = FindViewById<CheckBox>(Resource.Id.chkDone);
			
			// find all our controls
			cancelDeleteButton = FindViewById<Button>(Resource.Id.btnCancelDelete);
			
			
			// set the cancel delete based on whether or not it's an existing task
			cancelDeleteButton.Text = (taskItem.ID == 0 ? "Cancel" : "Delete");
			
			// name
			nameTextEdit.Text = taskItem.Name;
			
			// notes
			notesTextEdit.Text = taskItem.Notes;

			// done
			doneCheckbox.Checked = taskItem.Done;

			// button clicks 
			cancelDeleteButton.Click += (sender, e) => { CancelDelete(); };
			saveButton.Click += (sender, e) => { Save(); };
		}
コード例 #4
0
 public TaskViewModel (TaskItem item)
 {
     Update (item);
 }
コード例 #5
0
		public TaskDialog (TaskItem task)
		{
			Name = task.Name;
			Notes = task.Notes;
			Done = task.Done;
		}
コード例 #6
0
		public int SaveTask (TaskItem item)
		{
            return repository.SaveTask(item);
		}
コード例 #7
0
		public int SaveTask (TaskItem item)
		{
			return db.SaveItem<TaskItem>(item);
		}