/// <summary> /// Load older messages /// </summary> private async void LoadOlderMessages() { // Prevent a second call DisableLoadingMessages = true; // Show loading indicator MessagesLoadingTop.Visibility = Visibility.Visible; // Get messages List <MessageContainer> messages = await MessageManager.ConvertMessage( (await RESTCalls.GetChannelMessagesBefore(ChannelId, (MessageList.Items.FirstOrDefault(x => (x as MessageContainer).Message != null) as MessageContainer) .Message.Id)).ToList()); // Display Messages AddMessages(Position.Before, false, messages, _outofboundsNewMessage); //if there is an out of bounds new message, show the indicator. Otherwise, don't. // Hide loaidng indicator MessagesLoadingTop.Visibility = Visibility.Collapsed; // Buffer perioud for loading more messages await Task.Delay(1000); DisableLoadingMessages = false; }