Exemplo n.º 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;
        }
Exemplo n.º 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 ();
		}
Exemplo n.º 3
0
 public int Update(TodoItem todoItem)
 {
     _todoItems [todoItem.Id] = todoItem;
     return todoItem.Id;
 }
Exemplo n.º 4
0
 public int Create(TodoItem todoItem)
 {
     _todoItems.Add (_idIterator, todoItem);
     _idIterator++;
     return _idIterator;
 }