private void LoadToDoLists() { RemoveStackPanelItems(); var result = _toDoListRepository.GetToDoList(); foreach (var item in result) { var newBtn = new Button { Content = item.Name, Name = "_" + item.Id }; var margin = newBtn.Margin; margin.Top = 5; newBtn.Margin = margin; newBtn.Click += ToDoButton_Click; StackPanel.Children.Add(newBtn); } }
public List <ToDoListObject> GetToDoList() { return(_ToDoListObject.GetToDoList()); }