Beispiel #1
0
        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;
        }
Beispiel #2
0
 public Task Add(Post post)
 {
     return post.Post();
 }
Beispiel #3
0
        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;
            };
        }