Пример #1
0
        private async void AddConversationAsync()
        {
            IsLoading = true;

            // Reset the text box.
            var text = ConversationText;

            ConversationText = "";

            // Create a local message and add it.
            var newConversation = new ConversationModel
            {
                Preview       = text,
                UniqueSenders = new List <string> {
                    _configService.User.DisplayName
                },
                IsOwnedByUser = true
            };

            Conversations.Add(newConversation);
            OnConversationsChanged();

            // Create the request object.
            var newThread = new NewConversationModel
            {
                Topic = "Property Manager",
                Posts = new List <NewPostModel>
                {
                    new NewPostModel
                    {
                        Body            = new BodyModel(text, "html"),
                        NewParticipants = new List <ParticipantModel>
                        {
                            new ParticipantModel(_configService.User.DisplayName,
                                                 _configService.User.Mail)
                        }
                    }
                }
            };

            // Add the message.
            await _graphService.AddGroupConversation(Group, newThread);

            IsLoading = false;
        }
 public Task <NewConversationModel> AddGroupConversation(GroupModel group, NewConversationModel conversation)
 {
     return(PostAsync($"groups/{group.Id}/threads", conversation));
 }