コード例 #1
0
        private void SendAttachment(BlobUploadInfo blobUploadInfo)
        {
            if (string.IsNullOrEmpty(blobUploadInfo.UId))
                return;

            var attachment = new AttachmentTag
            {
                Id = blobUploadInfo.UId,
                Type = "image"
            };

            groupChatManager.SendAttachemnt(attachment);
        }
コード例 #2
0
        private async Task SendAttachment(BlobUploadInfo blobUploadInfo, string imageUrl)
        {
            if (string.IsNullOrEmpty(blobUploadInfo.UId))
                return;

            var attachment = new AttachmentTag
            {
                Id = blobUploadInfo.UId,
                Type = "image"
            };

            privateChatManager.SendAttachemnt(attachment);

            var messageViewModel = new MessageViewModel()
            {
                AttachedImage = new BitmapImage(new Uri(imageUrl)),
                MessageType = MessageType.Outgoing,
                DateTime = DateTime.Now
            };

            await MessageCollectionViewModel.AddNewMessage(messageViewModel);
            var dialogsManager = ServiceLocator.Locator.Get<IDialogsManager>();
            await dialogsManager.UpdateDialogLastMessage(dialog.Id, "Attachment", DateTime.Now);
        }