private void Populate() { OperationResult listResult = MainDB.ListAll(); if (listResult.Code > 0) { List <Item> items = (List <Item>)listResult.Data; //DateTime currentDate = items[0].Date; //AddDate(currentDate); foreach (Item item in items) { // Refreshes current date labelling //if (!item.Date.ToShortDateString().Equals(currentDate.ToShortDateString())) //{ // currentDate = item.Date; // AddDate(currentDate); //} ItemContainer itemContainer = new ItemContainer(item); itemContainer.BodyVisibility = Visibility.Collapsed; itemContainer.ButtonDone.Click += (sender, e) => ItemButtonDone_Click(sender, e, itemContainer); //ImageLabelButton button = new ImageLabelButton() //{ // Icon = GetIcon(item.Type), // Text = item.Value //}; //button.Click += (sender, e) => Item_Click(sender, e, item); //button.Click += (sender, e) => Item_Click(sender, e, item); StackChat.Children.Add(itemContainer); } } Scroller.ScrollToBottom(); State = QueryType.Default; }