News as messages

Screenshot: news message table

Screenshot: news panel with the story of the selected news

NewsMessageGrid - a news table that works with NewsMessage messages instead of business entities. It shows the time, source, identifier, headline and the link to the full story.

Main properties

The ready made pair of the table and the story text is NewsMessagePanel. It hosts NewsMessageGrid and NewsStoryPanel: when a row is selected the panel requests the story from the subscription provider and shows it at the bottom.

Below are code snippets showing its usage:

<Window x:Class="Sample.NewsWindow"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:xaml="http://schemas.stocksharp.com/xaml"
	Height="400" Width="900">
	<xaml:NewsMessagePanel x:Name="NewsPanel" />
</Window>
// Set the subscription provider - the news story is requested through it
NewsPanel.SubscriptionProvider = _connector;

// Add incoming news to the table on the user interface thread
_connector.NewsReceived += (subscription, news) =>
	this.GuiAsync(() => NewsPanel.NewsGrid.Messages.Add(news.ToMessage()));

// Create the news subscription
_connector.Subscribe(new Subscription(DataType.News));

See also

Market-data