Exemplo n.º 1
0
        private void addPostButton(object sender, EventArgs e)
        {
            EditText editText = FindViewById <EditText>(Resource.Id.content);

            posts.Add(new Post
            {
                Name     = "User",
                Message  = editText.Text,
                Likes    = 0,
                Date     = DateTimeOffset.Now,
                Comments = new List <Comment>()
            });
            editText.Text = "";
            ListAdapter   = new PostAdapter(this, posts);
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            if (posts == null)
            {
                TestPosts();
            }

            ListAdapter = new PostAdapter(this, posts);

            FindViewById <Button>(Resource.Id.addPost).Click += addPostButton;
        }