예제 #1
0
        public TodoDetail(TodoItem todoItem)
        {
            BindingContext = todoItem;
            var titleLabel = new Label () {
                FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
                Text = todoItem.Title
            };

            var descriptionLabel = new Label{
                FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                Text = todoItem.Description
            };
            Content = new StackLayout {
                Children = {
                    titleLabel,
                    descriptionLabel
                },
            };
            Padding = new Thickness (10, Device.OnPlatform (20, 0, 0));

            ToolbarItems.Add (new ToolbarItem {
                Text = todoItem.IsCompleted ? "Gjenåpne" : "Fullfør",
                Order = ToolbarItemOrder.Primary,
                Command = new Command(Complete)
            });

            Title = todoItem.Title;
        }
예제 #2
0
		async Task AddTodoPopup(){
			var status = await UserDialogs.Instance.PromptAsync(new PromptConfig {
				Title = "Legg til todo",
				Text = "",
				IsCancellable = true,
				OkText = "Lagre"
			});

			var todoItem = new TodoItem();
			//todoItem. = DateTime.UtcNow;
			todoItem.Title = status.Text;
			_dataService.Create (todoItem);
			var todoItems = _dataService.GetAll ();
			_listView.ItemsSource = todoItems.ToList ();
		}
예제 #3
0
 public int Update(TodoItem todoItem)
 {
     _todoItems [todoItem.Id] = todoItem;
     return todoItem.Id;
 }
예제 #4
0
 public int Create(TodoItem todoItem)
 {
     _todoItems.Add (_idIterator, todoItem);
     _idIterator++;
     return _idIterator;
 }