Created
December 15, 2017 14:29
-
-
Save juucustodio/4858299c574383a3cf67ce091982c273 to your computer and use it in GitHub Desktop.
Example of Chat in Xamarin.Forms applications - http://julianocustodio.com/chat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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