本文整理汇总了C#中IChatService.GetContacts方法的典型用法代码示例。如果您正苦于以下问题:C# IChatService.GetContacts方法的具体用法?C# IChatService.GetContacts怎么用?C# IChatService.GetContacts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IChatService
的用法示例。
在下文中一共展示了IChatService.GetContacts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChatViewModel
public ChatViewModel(IChatService chatService)
{
_contacts = new ObservableCollection<Contact>();
_contactsView = new CollectionView(_contacts);
_sendMessageRequest = new InteractionRequest<SendMessageViewModel>();
_showReceivedMessageRequest = new InteractionRequest<ReceivedMessage>();
_showDetailsCommand = new ShowDetailsCommandImplementation(this);
_contactsView.CurrentChanged += OnCurrentContactChanged;
_chatService = chatService;
_chatService.Connected = true;
_chatService.ConnectionStatusChanged += (s, e) => RaisePropertyChanged(() => CurrentConnectionState);
_chatService.MessageReceived += OnMessageReceived;
_chatService.GetContacts(
result =>
{
if (result.Error != null) return;
foreach (var item in result.Result)
{
_contacts.Add(item);
}
});
RaisePropertyChanged(() => CurrentConnectionState);
}