Click or drag to resize

Table

PortfolioGrid is a component that displays the status of portfolios and positions.

GUI PortfolioGrid

Main properties

Below is the code snippet with its use. The code example is taken from Samples/InteractiveBrokers/SampleIB.

XAML
<Window x:Class="Sample.PortfoliosWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:loc="clr-namespace:StockSharp.Localization;assembly=StockSharp.Localization"
        xmlns:xaml="http://schemas.stocksharp.com/xaml"
        Title="{x:Static loc:LocalizedStrings.Portfolios}" Height="200" Width="470">
  <xaml:PortfolioGrid x:Name="PortfolioGrid" x:FieldModifier="public" />
</Window>
C#
private readonly Connector _connector = new Connector();

private void ConnectClick(object sender, RoutedEventArgs e)
{
    .........................................................                
    _connector.NewPortfolio += portfolio => _portfoliosWindow.PortfolioGrid.Portfolios.Add(portfolio);
    _connector.NewPosition += position => _portfoliosWindow.PortfolioGrid.Positions.Add(position);
    .........................................................
}