Ejemplo n.º 1
0
 /// <summary>
 /// Recreates a <see cref="ChatMessage"/> from a <see cref="ChatMessageStore"/>.
 /// </summary>
 /// <param name="store"><see cref="ChatMessageStore"/> to create from</param>
 /// <returns>Recreated <see cref="ChatMessage"/></returns>
 public static ChatMessage FromChatMessageStore(ChatMessageStore store)
 {
     return(new ChatMessage(
                messageId: store.MessageId,
                senderUuid: store.SenderUuid,
                message: store.Message,
                timestamp: store.Timestamp.ToDateTime()
                ));
 }
Ejemplo n.º 2
0
        private async void Load()
        {
            BackgroundTaskUtils.RegisterToastNotificationBackgroundTasks();
            ContactUtils.AssignAppToPhoneContacts();
            ChatMessageStore store = await ChatMessageManager.RequestStoreAsync();

            var reader = store.GetConversationReader();
            var convos = await reader.ReadBatchAsync();

            bool initializedonce = false;

            foreach (var convo in convos)
            {
                NavigationView.MenuItems.Add(new ChatMenuItemControl(convo));

                if (!initializedonce)
                {
                    NavigationView.SelectedItem = NavigationView.MenuItems[0];
                }

                initializedonce = true;
            }
        }