private static async Task FillStatus(StackPanel view, Account account, Models.Status status) { Grid message = new Grid(); message.ColumnDefinitions.Add(new ColumnDefinition { Width = GridLength.Auto }); message.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(10, GridUnitType.Pixel) }); message.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); message.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); message.RowDefinitions.Add(new RowDefinition { Height = new GridLength(10, GridUnitType.Pixel) }); Image image = new Image { Source = new BitmapImage(new Uri("ms-appx:///Assets/smilie.png", UriKind.Absolute)), Width = 50, Height = 50, }; Grid.SetColumn(image, 0); Grid.SetRow(image, 0); TextBlock text = new TextBlock { Text = "Was " + await Api.Do.MoodDescription(status.MoodId), TextWrapping = TextWrapping.Wrap, VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Center, FontSize = 20 }; Grid.SetColumn(text, 2); Grid.SetRow(text, 0); message.Children.Add(image); message.Children.Add(text); view.Children.Add(message); }
public Task<Status> CreateStatus(Status status) { status.Id = random.Next(); statuses.Add(status.Id, status); return Task.FromResult(status); }