public PostViewModel(Post post) { this.Source = post; this.Id = post.Id; this.UserId = post.UserId; this.UserName = post.UserName; this.Message = post.Message; this.At = post.At; this.HubId = post.HubId; }
public Task Add(Post post) { return post.Post(); }
private void InitializeInput() { EditText messageBox = FindViewById<EditText>(Resource.Id.postText); Button postButton = FindViewById<Button>(Resource.Id.postButton); postButton.Click += delegate { var post = new Post { Message = messageBox.Text.Trim(), HubId = CommonData.Hub.Id }; if (post.Message == string.Empty) return; this.postAdapter.Add(post); messageBox.Text = string.Empty; }; }