private void ArticleService_MessageCollectionStrReceivedEvent(string message) { var mesList = GetColFromStr.GetColFromString(message); MessageToMessageClient converter = new MessageToMessageClient(); MessagesColl = new ObservableCollection <MessageClient>(converter.Convert(mesList)); }
public MainViewModel() { var articleService = new ArticleServiceCallback(); articleService.MessageCollectionStrReceivedEvent += ArticleService_MessageCollectionStrReceivedEvent;; _articleServiceProxy = new ArticleServiceProxy(articleService); _serviceChannel = _articleServiceProxy.ChannelFactory.CreateChannel(); Article = File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "Article.txt"); var colStr = _serviceChannel.GetMessagesColStr(); var mesList = GetColFromStr.GetColFromString(colStr); MessageToMessageClient converter = new MessageToMessageClient(); MessagesColl = new ObservableCollection <MessageClient>(converter.Convert(mesList)); }