Skip to content

Instantly share code, notes, and snippets.

@juucustodio
Created December 15, 2017 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juucustodio/4858299c574383a3cf67ce091982c273 to your computer and use it in GitHub Desktop.
Save juucustodio/4858299c574383a3cf67ce091982c273 to your computer and use it in GitHub Desktop.
Example of Chat in Xamarin.Forms applications - http://julianocustodio.com/chat
using DemoChat.ViewModels;
using Xamarin.Forms;
namespace DemoChat.Views
{
public partial class MainPage
{
MainPageViewModel vm;
public MainPage()
{
InitializeComponent();
BindingContext = vm = new MainPageViewModel();
vm.ListMessages.CollectionChanged += (sender, e) =>
{
var target = vm.ListMessages[vm.ListMessages.Count - 1];
MessagesListView.ScrollTo(target, ScrollToPosition.End, true);
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment