private void CreateStories() { var yPos = startYPos; var xPos = (Story.ActualWidth - CARD_WIDTH) / 2; foreach (var story in sbvm.Stories) { var storyControl = new StoryControl(); storyControl.DataContext = story; storyControl.SetValue(Canvas.LeftProperty, xPos); storyControl.SetValue(Canvas.TopProperty, yPos); // LightGreen, Khaki Salmon, LightSkyBlue storyControl.Background = story.CardColour; storyYPositions.Add(story.Number, yPos); yPos += CARD_HEIGHT + CARD_SPACE_OFFSET; SprintBoard.Children.Add(storyControl); } SprintBoard.Height = yPos; // Loops through creating storie controls. // Setting Data context to be the story in the OC }