641 lines
35 KiB
XML
641 lines
35 KiB
XML
<UserControl
|
|
x:Class="mbts.spark.LadderView"
|
|
x:ClassModifier="internal"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mbts="clr-namespace:mbts.ui"
|
|
xmlns:controls="clr-namespace:mbts.ui.controls"
|
|
xmlns:spark="clr-namespace:mbts.spark"
|
|
xmlns:uag="clr-namespace:mbts.ui.spark.algo"
|
|
xmlns:converters="clr-namespace:mbts.ui.converters"
|
|
xmlns:txt="clr-namespace:mbts.ui.utility.text"
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
Height="600"
|
|
Width="420"
|
|
Background="{x:Static mbts:BTSColors.common_background_brush}"
|
|
TextElement.FontSize="{x:Static mbts:FontSizes.Small}"
|
|
>
|
|
<UserControl.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<ResourceDictionary Source="/view/Controls/Order/OrderDetailsPopupControl.xaml"/>
|
|
<ResourceDictionary Source="/view/Controls/Order/AlgoParamsView.xaml"/>
|
|
<ResourceDictionary Source="/view/Controls/Order/AlgoTemplateFavoriteButtonsView.xaml"/>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
<converters:BooleanToVisibilityConverter x:Key="BoolToInVisibility" VisibilityForTrue="Collapsed" VisibilityForFalse="Visible" />
|
|
<converters:BooleanToObjectConverter x:Key="bool_to_margin">
|
|
<converters:BooleanToObjectConverter.ValueForTrue>
|
|
<Thickness />
|
|
</converters:BooleanToObjectConverter.ValueForTrue>
|
|
<converters:BooleanToObjectConverter.ValueForFalse>
|
|
<Thickness Top="32" />
|
|
</converters:BooleanToObjectConverter.ValueForFalse>
|
|
</converters:BooleanToObjectConverter>
|
|
<converters:EnumCharacterCasingConverter x:Key="casing_converter"/>
|
|
<converters:GridLengthConverter x:Key="GridLengthPixelConverter" UnitType="Pixel" />
|
|
<converters:ResponsiveTextConverter x:Key="DayTextConverter" LongText="Day:" ShortText="D:" Threshold="99" />
|
|
<converters:ResponsiveTextConverter x:Key="HighTextConverter" LongText="High:" ShortText="H:" Threshold="99" />
|
|
<converters:ResponsiveTextConverter x:Key="LowTextConverter" LongText="Low:" ShortText="L:" Threshold="99" />
|
|
<converters:ResponsiveTextConverter x:Key="OpenTextConverter" LongText="Open:" ShortText="O:" Threshold="99" />
|
|
<converters:ResponsiveTextConverter x:Key="SettleTextConverter" LongText="Settle:" ShortText="S:" Threshold="99" />
|
|
<converters:ResponsiveTextConverter x:Key="VolumeTextConverter" LongText="Volume:" ShortText="V:" Threshold="99" />
|
|
<converters:DoubleSubtractionConverter x:Key="DoubleSubtractionConverter" Value="4" />
|
|
<converters:DoubleSubtractionConverter x:Key="HeightDoubleSubtractionConverter" Value="6" />
|
|
<Style TargetType="GridViewColumnHeader">
|
|
<Setter Property="Background" Value="{mbts:BTSColor header}"/>
|
|
<Setter Property="Foreground" Value="{mbts:BTSColor header_text}"/>
|
|
<Setter Property="BorderBrush" Value="{mbts:BTSColor header_border}"/>
|
|
<Setter Property="BorderThickness" Value="0,0,1,0"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
<Setter Property="Height" Value="23" />
|
|
<Setter Property="MinWidth" Value="30" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
|
|
<Grid SnapsToDevicePixels="True">
|
|
<Border x:Name="HeaderBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition MaxHeight="7"/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<Border Padding="{TemplateBinding Padding}" Grid.RowSpan="2">
|
|
<ContentPresenter x:Name="HeaderContent"
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
Content="{TemplateBinding Content}"
|
|
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
Margin="0,0,0,1"
|
|
RecognizesAccessKey="True"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
<Canvas MinWidth="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=MinWidth, Mode=OneTime}">
|
|
<Thumb x:Name="PART_HeaderGripper" DragDelta="Thumb_DragDelta">
|
|
<Thumb.Style>
|
|
<Style TargetType="{x:Type Thumb}">
|
|
<Setter Property="Canvas.Right" Value="-9"/>
|
|
<Setter Property="Width" Value="18"/>
|
|
<Setter Property="Height" Value="{Binding ActualHeight, RelativeSource={RelativeSource TemplatedParent}}"/>
|
|
<Setter Property="Padding" Value="0"/>
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Thumb}">
|
|
<Border Background="Transparent" Padding="{TemplateBinding Padding}">
|
|
<Rectangle Fill="{TemplateBinding Background}" HorizontalAlignment="Center" Width="2"/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="{mbts:BTSColor header_text}"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</Thumb.Style>
|
|
</Thumb>
|
|
</Canvas>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="LadderLastHeaderStyle" TargetType ="{x:Type GridViewColumnHeader}" BasedOn="{StaticResource {x:Type GridViewColumnHeader}}">
|
|
<Setter Property="BorderThickness" Value="0,0,0,0"/>
|
|
<Setter Property="Width" Value="75"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
|
|
<Grid SnapsToDevicePixels="True">
|
|
<Border x:Name="HeaderBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition MaxHeight="7"/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<Border Padding="{TemplateBinding Padding}" Grid.RowSpan="2">
|
|
<ContentPresenter x:Name="HeaderContent"
|
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
Content="{TemplateBinding Content}"
|
|
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
Margin="0,0,0,1"
|
|
RecognizesAccessKey="True"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="LadderMenuButton" TargetType="Button">
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
|
<Setter Property="Margin" Value="2,0,2,5"/>
|
|
<Setter Property="Padding" Value="2"/>
|
|
</Style>
|
|
<Style x:Key="CancelBuys" TargetType="Button" BasedOn="{StaticResource LadderMenuButton}">
|
|
<Setter Property="Content">
|
|
<Setter.Value>
|
|
<TextBlock VerticalAlignment="Center" Foreground="{Binding bid_foreground}">Cancel Buys</TextBlock>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border
|
|
x:Name="Border"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
BorderBrush="{mbts:BTSColor UI.Button.normal_border}"
|
|
Background="{Binding bid_background}"
|
|
Padding="{TemplateBinding Padding}"
|
|
SnapsToDevicePixels="True"
|
|
>
|
|
<ContentPresenter
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
RecognizesAccessKey="True"
|
|
Name="button_content"
|
|
/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Border" Property="Background" Value="#99167ed3" />
|
|
<Setter TargetName="Border" Property="BorderBrush" Value="{mbts:BTSColor UI.Button.mouseover_border}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="CancelSells" TargetType="Button" BasedOn="{StaticResource LadderMenuButton}">
|
|
<Setter Property="Background" Value="{mbts:BTSColor MarketData.ask}" />
|
|
<Setter Property="Content">
|
|
<Setter.Value>
|
|
<TextBlock VerticalAlignment="Center" Foreground="{Binding ask_foreground}">Cancel Sells</TextBlock>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border
|
|
x:Name="Border"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
BorderBrush="{mbts:BTSColor UI.Button.normal_border}"
|
|
Background="{Binding ask_background}"
|
|
Padding="{TemplateBinding Padding}"
|
|
SnapsToDevicePixels="True"
|
|
>
|
|
<ContentPresenter
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
RecognizesAccessKey="True"
|
|
Name="button_content"
|
|
/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Border" Property="Background" Value="#99c00000" />
|
|
<Setter TargetName="Border" Property="BorderBrush" Value="{mbts:BTSColor UI.Button.mouseover_border}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="CancelAll" TargetType="Button" BasedOn="{StaticResource LadderMenuButton}">
|
|
<Setter Property="Content">
|
|
<Setter.Value>
|
|
<TextBlock VerticalAlignment="Center">Cancel All</TextBlock>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border
|
|
x:Name="Border"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
BorderBrush="{mbts:BTSColor UI.Button.normal_border}"
|
|
Background="{mbts:BTSColor UI.Button.normal_background}"
|
|
Padding="{TemplateBinding Padding}"
|
|
SnapsToDevicePixels="True">
|
|
<ContentPresenter
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
RecognizesAccessKey="True"
|
|
Name="button_content"
|
|
/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Border" Property="Background" Value="{mbts:BTSColor UI.Button.mouseover_background}" />
|
|
<Setter TargetName="Border" Property="BorderBrush" Value="{mbts:BTSColor UI.Button.mouseover_border}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="SettingsButton" TargetType="Button" BasedOn="{StaticResource LadderMenuButton}">
|
|
<Setter Property="Content">
|
|
<Setter.Value>
|
|
<TextBlock VerticalAlignment="Center">Settings</TextBlock>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border
|
|
x:Name="Border"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
BorderBrush="{mbts:BTSColor UI.Button.normal_border}"
|
|
Background="{mbts:BTSColor UI.Button.normal_background}"
|
|
Padding="{TemplateBinding Padding}"
|
|
SnapsToDevicePixels="True"
|
|
Margin="2,0,2,10">
|
|
<ContentPresenter
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
RecognizesAccessKey="True"
|
|
Name="button_content"
|
|
/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Border" Property="Background" Value="{mbts:BTSColor UI.Button.mouseover_background}" />
|
|
<Setter TargetName="Border" Property="BorderBrush" Value="{mbts:BTSColor UI.Button.mouseover_border}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<sys:Double x:Key="MaxZoomFactor">1.5</sys:Double>
|
|
<sys:Double x:Key="MinZoomFactor">0.5</sys:Double>
|
|
</ResourceDictionary>
|
|
</UserControl.Resources>
|
|
<AdornerDecorator>
|
|
<Grid x:Name="_root">
|
|
<Grid.LayoutTransform>
|
|
<ScaleTransform CenterX="0" CenterY="0"
|
|
ScaleX="{Binding ElementName=_ui_scaler, Path=Value}"
|
|
ScaleY="{Binding ElementName=_ui_scaler, Path=Value}"
|
|
/>
|
|
</Grid.LayoutTransform>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition
|
|
Width="{Binding left_panel_width, Mode=TwoWay, Converter={StaticResource GridLengthPixelConverter}}"
|
|
MinWidth="{x:Static spark:LadderView.MinLeftPanelWidth}"
|
|
MaxWidth="{x:Static spark:LadderView.MaxLeftPanelWidth}"
|
|
/>
|
|
<ColumnDefinition/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<ScrollViewer
|
|
x:Name="_left_panel_scroll"
|
|
Grid.Row="0"
|
|
Grid.RowSpan="2"
|
|
mbts:ScrollViewerBehavior.VerticalOffset="{Binding left_panel_scroll_position, Mode=TwoWay}"
|
|
mbts:ScrollViewerBehavior.EnableTwoWayVerticalOffsetBinding="True"
|
|
VerticalScrollBarVisibility="Hidden"
|
|
>
|
|
<Grid RowSpan="2" Background="{mbts:BTSColor UI.spark_menu_background}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition/>
|
|
</Grid.RowDefinitions>
|
|
<StackPanel Margin="2,0,5,0">
|
|
<StackPanel.Resources>
|
|
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
|
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
|
</Style>
|
|
</StackPanel.Resources>
|
|
<StackPanel x:Name="_slider_stack_panel" Margin="5,5,5,0">
|
|
<Slider
|
|
x:Name="_ui_scaler"
|
|
Value="{Binding zoom_factor}"
|
|
Minimum="{x:Static spark:LadderView.MinZoomFactor}"
|
|
Maximum="{x:Static spark:LadderView.MaxZoomFactor}"
|
|
Width="{Binding Path=ActualWidth, ElementName=_slider_stack_panel}"
|
|
Visibility="{Binding show_zoom, Converter={StaticResource BooleanToVisibilityConverter}}"
|
|
/>
|
|
</StackPanel>
|
|
<Grid Margin="2,4,2,0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="6"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<!-- Day -->
|
|
<TextBlock Grid.Column="0" Grid.Row="0"
|
|
Text="{Binding left_panel_width, Converter={StaticResource DayTextConverter}}"
|
|
Margin="0,0,0,4"
|
|
Visibility="{Binding show_day, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
<TextBlock Grid.Column="2" Grid.Row="0" FontWeight="Bold"
|
|
Margin="0,0,0,4"
|
|
Foreground="{Binding change, Converter={StaticResource NumericSignBrushConverter}}"
|
|
Visibility="{Binding show_day, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<TextBlock.Text>
|
|
<MultiBinding Converter="{StaticResource TickDisplayConverter}" Mode="OneWay">
|
|
<Binding Path="change"/>
|
|
<Binding Path="security.ContractSpec"/>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
<!-- High -->
|
|
<TextBlock Grid.Column="0" Grid.Row="1"
|
|
Text="{Binding left_panel_width, Converter={StaticResource HighTextConverter}}"
|
|
Margin="0,0,0,4"
|
|
Visibility="{Binding show_high, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
<TextBlock Grid.Column="2" Grid.Row="1" Foreground="{mbts:BTSColor UI.default_text}" FontWeight="Bold"
|
|
Margin="0,0,0,4"
|
|
Visibility="{Binding show_high, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<TextBlock.Text>
|
|
<MultiBinding Converter="{StaticResource TickDisplayConverter}" Mode="OneWay">
|
|
<Binding Path="high"/>
|
|
<Binding Path="security.ContractSpec"/>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
<!-- Low -->
|
|
<TextBlock Grid.Column="0" Grid.Row="2"
|
|
Text="{Binding left_panel_width, Converter={StaticResource LowTextConverter}}"
|
|
Margin="0,0,0,4"
|
|
Visibility="{Binding show_low, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
<TextBlock Grid.Column="2" Grid.Row="2" Foreground="{mbts:BTSColor UI.default_text}" FontWeight="Bold"
|
|
Margin="0,0,0,4"
|
|
Visibility="{Binding show_low, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<TextBlock.Text>
|
|
<MultiBinding Converter="{StaticResource TickDisplayConverter}" Mode="OneWay">
|
|
<Binding Path="low"/>
|
|
<Binding Path="security.ContractSpec"/>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
<!-- Open -->
|
|
<TextBlock Grid.Column="0" Grid.Row="3"
|
|
Text="{Binding left_panel_width, Converter={StaticResource OpenTextConverter}}"
|
|
Margin="0,0,0,4"
|
|
Visibility="{Binding show_open, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
<TextBlock Grid.Column="2" Grid.Row="3" FontWeight="Bold"
|
|
Margin="0,0,0,4"
|
|
Visibility="{Binding show_open, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<TextBlock.Text>
|
|
<MultiBinding Converter="{StaticResource TickDisplayConverter}" Mode="OneWay">
|
|
<Binding Path="open"/>
|
|
<Binding Path="security.ContractSpec"/>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
<!-- Settle -->
|
|
<TextBlock Grid.Column="0" Grid.Row="4"
|
|
Text="{Binding left_panel_width, Converter={StaticResource SettleTextConverter}}"
|
|
Margin="0,0,0,4"
|
|
Visibility="{Binding show_settle, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
<TextBlock Grid.Column="2" Grid.Row="4" FontWeight="Bold"
|
|
Margin="0,0,0,4"
|
|
Visibility="{Binding show_settle, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<TextBlock.Text>
|
|
<MultiBinding Converter="{StaticResource TickDisplayConverter}" Mode="OneWay">
|
|
<Binding Path="settlement"/>
|
|
<Binding Path="security.ContractSpec"/>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
<!-- Volume -->
|
|
<TextBlock Grid.Column="0" Grid.Row="5"
|
|
Text="{Binding left_panel_width, Converter={StaticResource VolumeTextConverter}}"
|
|
Margin="0,0,0,4"
|
|
Visibility="{Binding show_volume, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
<TextBlock Grid.Column="2" Grid.Row="5" Text="{Binding volume, Mode=OneWay}" FontWeight="Bold"
|
|
Margin="0,0,0,4"
|
|
Visibility="{Binding show_volume, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
</Grid>
|
|
<!-- Account combobox -->
|
|
<ComboBox DataContext="{Binding order_properties_vm}" Margin="2,10,2,2"
|
|
ItemsSource="{Binding accounts}" SelectedItem="{Binding selected_account}"
|
|
Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}},
|
|
Path = DataContext.show_account,
|
|
Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
<!-- TIF combobox-->
|
|
<ComboBox DataContext="{Binding order_properties_vm}" ItemsSource="{Binding time_in_forces}"
|
|
SelectedItem="{Binding selected_time_in_force}" Margin="2"
|
|
Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}},
|
|
Path = DataContext.show_tif,
|
|
Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Converter={StaticResource casing_converter}, ConverterParameter=Upper}" />
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
<!-- Order Type combobox -->
|
|
<uag:OrderDetailsPopupControl
|
|
DataContext="{Binding order_properties_vm}"
|
|
Margin="2"
|
|
ExpandDirection="Left"
|
|
HasEditableProperties="{Binding can_expand}"
|
|
IsOpen="{Binding is_expanded}"
|
|
ItemsSource="{Binding algo_definitions_view}"
|
|
SelectedItem="{Binding selected_algo_definition}"
|
|
Visibility="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path = DataContext.show_order_type, Converter={StaticResource BooleanToVisibilityConverter}}"
|
|
>
|
|
<uag:OrderDetailsPopupControl.Resources>
|
|
<Style TargetType="TextBox">
|
|
<Setter Property="mbts:TextBoxBehavior.EnterKeyBehavior" Value="CommitAndRelease"/>
|
|
<Setter Property="mbts:TextBoxBehavior.ReleaseOnEscape" Value="True"/>
|
|
</Style>
|
|
</uag:OrderDetailsPopupControl.Resources>
|
|
</uag:OrderDetailsPopupControl>
|
|
<!-- Position into qty button -->
|
|
<Button
|
|
Margin="2"
|
|
Command="{Binding position_click_command}"
|
|
Content="{Binding position_display_text}"
|
|
FontWeight="Bold"
|
|
Foreground="{Binding position, Converter={StaticResource NumericSignBrushConverter}}"
|
|
>
|
|
<Button.Visibility>
|
|
<MultiBinding>
|
|
<MultiBinding.Converter>
|
|
<converters:MultiValueConverterPipe>
|
|
<converters:BooleanOrConverter/>
|
|
<converters:BooleanToVisibilityConverter/>
|
|
</converters:MultiValueConverterPipe>
|
|
</MultiBinding.Converter>
|
|
<Binding Path="show_day_position"/>
|
|
<Binding Path="show_raw_day_position"/>
|
|
<Binding Path="show_account_position"/>
|
|
</MultiBinding>
|
|
</Button.Visibility>
|
|
<Button.ToolTip>
|
|
<!--<TextBlock Text="{Binding order_properties_vm.selected_account, StringFormat='{}{0} total position (click to copy to size)'}"/>-->
|
|
<TextBlock TextAlignment="Center">
|
|
<TextBlock.Text>
|
|
<MultiBinding Converter="{x:Static spark:LadderView.PositionToolTipConverter}">
|
|
<Binding Path="order_properties_vm.selected_account"/>
|
|
<Binding Path="show_day_position"/>
|
|
<Binding Path="show_raw_day_position"/>
|
|
<Binding Path="show_account_position"/>
|
|
</MultiBinding>
|
|
</TextBlock.Text>
|
|
</TextBlock>
|
|
</Button.ToolTip>
|
|
</Button>
|
|
<!-- Qty textbox -->
|
|
<TextBox
|
|
mbts:TextBoxBehavior.InputFilter="{mbts:RegexInputFilter Regex={x:Static Member=UnsignedInteger, MemberType={mbts:Nested txt:TextUtils.RegexFilters}}}"
|
|
mbts:TextBoxBehavior.IncrementDecrementOnMouseClick="True"
|
|
HorizontalContentAlignment="Right"
|
|
Margin="2"
|
|
Text="{Binding size_calculator.value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
ContextMenu="{x:Null}"
|
|
/>
|
|
<!-- Qty quick buttons -->
|
|
<ItemsControl
|
|
ItemsSource="{Binding size_calculator.buttons}" Focusable="False"
|
|
Visibility="{Binding show_size_preset, Converter={StaticResource BooleanToVisibilityConverter}}"
|
|
>
|
|
<ItemsControl.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<UniformGrid Columns="2" Focusable="False"/>
|
|
</ItemsPanelTemplate>
|
|
</ItemsControl.ItemsPanel>
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Button Margin="2" Command="{Binding Path=DataContext.size_calculator.click, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding}" Content="{Binding}" Focusable="False"/>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
<!-- Clear button -->
|
|
<Button Margin="2" HorizontalAlignment="Stretch" Command="{Binding size_calculator.clear}"
|
|
Visibility="{Binding show_clear, Converter={StaticResource BooleanToVisibilityConverter}}">Clear</Button>
|
|
<!-- Auto Clear button - reset to defaults after order -->
|
|
<CheckBox Margin="2" IsChecked="{Binding auto_clear}"
|
|
Visibility="{Binding show_auto_clear, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
Auto Clear
|
|
</CheckBox>
|
|
<!--Algo Favorite Buttons-->
|
|
<uag:AlgoTemplateFavoriteButtonsView
|
|
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
|
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
|
ItemsSource="{Binding order_properties_vm.favorite_algo_definitions_view}"
|
|
SelectedItem="{Binding order_properties_vm.selected_favorite_algo_definition}"
|
|
>
|
|
<uag:AlgoTemplateFavoriteButtonsView.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<UniformGrid Columns="{Binding order_properties_vm.favorite_algos_column_count}" Focusable="False"/>
|
|
</ItemsPanelTemplate>
|
|
</uag:AlgoTemplateFavoriteButtonsView.ItemsPanel>
|
|
</uag:AlgoTemplateFavoriteButtonsView>
|
|
<StackPanel Margin="0,17,0,0" VerticalAlignment="Top">
|
|
<!-- Cancel Buttons -->
|
|
<Button Command="{Binding cancel_command}" CommandParameter="Bids" Style="{StaticResource CancelBuys}"
|
|
Visibility="{Binding show_cancel_buys, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
<Button Command="{Binding cancel_command}" CommandParameter="Asks" Style="{StaticResource CancelSells}"
|
|
Visibility="{Binding show_cancel_sells, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
<Button Command="{Binding cancel_command}" CommandParameter="All" Style="{StaticResource CancelAll}"
|
|
Visibility="{Binding show_cancel_all, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
</StackPanel>
|
|
<StackPanel Grid.Row="1" Margin="0,17,0,0" VerticalAlignment="Bottom">
|
|
<!-- Settings Button -->
|
|
<Button Command="{Binding settings_command}" Style="{StaticResource SettingsButton}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Grid>
|
|
</ScrollViewer>
|
|
<!-- Ladder Column Headers -->
|
|
<Border Grid.Column="2" HorizontalAlignment="Stretch">
|
|
<GridViewHeaderRowPresenter x:Name="_column_headers_presenter" AllowsColumnReorder="False" />
|
|
</Border>
|
|
<!-- LadderGridHost -->
|
|
<spark:LadderGridHost
|
|
x:Name="_ladder"
|
|
Grid.Column="2"
|
|
Grid.Row="1"
|
|
Command="{Binding send_order_command}"
|
|
Orders="{Binding orders}"
|
|
orders_column_width="{Binding orders_column_width, Mode=TwoWay}"
|
|
bid_column_width="{Binding bid_column_width, Mode=TwoWay}"
|
|
price_column_width="{Binding price_column_width, Mode=TwoWay}"
|
|
ask_column_width="{Binding ask_column_width, Mode=TwoWay}"
|
|
LastColumnWidth="{Binding last_column_width, Mode=TwoWay}"
|
|
PIQColumnWidth="{Binding piq_column_width, Mode=TwoWay}"
|
|
VolumeColumnWidth="{Binding volume_column_width, Mode=TwoWay}"
|
|
>
|
|
<spark:LadderGridHost.Resources>
|
|
<Style TargetType="controls:Badge">
|
|
<Setter Property="Background" Value="{Binding background}" />
|
|
<Setter Property="BorderBrush" Value="{Binding border}" />
|
|
<Setter Property="FontFamily" Value="{Binding font_family}"/>
|
|
<Setter Property="FontSize" Value="{Binding font_size}"/>
|
|
<Setter Property="Foreground" Value="{Binding foreground}"/>
|
|
<Setter Property="TextLines" Value="{Binding text_lines}" />
|
|
<!--<Setter Property="Width" Value="{x:Static controls:Badge.DefaultWidth}"/>-->
|
|
<Setter Property="Width" Value="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType={x:Type spark:LadderOrdersHost}}, Converter={StaticResource DoubleSubtractionConverter}}" />
|
|
<Setter Property="Height" Value="{Binding grid_row_height, Converter={StaticResource HeightDoubleSubtractionConverter}}" />
|
|
<Setter Property="HasMultipleOrdersAtLevel" Value="{Binding has_multiple_orders_at_same_level}" />
|
|
<Setter Property="IsHedgeOrder" Value="{Binding is_hedge_order}" />
|
|
<Setter Property="AlgoType" Value="{Binding algo_type}" />
|
|
<Setter Property="Abbreviation" Value="{Binding algo_studio_abbreviation}" />
|
|
<Setter Property="Cursor" Value="Hand"/>
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Background" Value="{Binding hoverbackground}" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</spark:LadderGridHost.Resources>
|
|
</spark:LadderGridHost>
|
|
<spark:RecenterCountdown Grid.Column="2" Grid.Row="1" Margin="0,0,18,0"
|
|
VerticalAlignment="Bottom" HorizontalAlignment="Right"
|
|
Width="30" Height="30"
|
|
Mode="Pie" Delay="0:0:10"
|
|
Background="{x:Null}" BorderBrush="{x:Null}"
|
|
PieBackground="Transparent"
|
|
SliceBackground="#a000"
|
|
Bus="{Binding bus}"
|
|
Command="{Binding RecenterCommand, ElementName=_ladder}">
|
|
<spark:RecenterCountdown.SliceStroke>
|
|
<Pen Thickness="1" Brush="Black" />
|
|
</spark:RecenterCountdown.SliceStroke>
|
|
<spark:RecenterCountdown.PieStroke>
|
|
<Pen Thickness="0" Brush="MediumPurple" />
|
|
</spark:RecenterCountdown.PieStroke>
|
|
</spark:RecenterCountdown>
|
|
<!-- Since the GridSplitter will share a cell with other elements,
|
|
we add it in toward the end, but we still want the ladder status
|
|
message to have the topmost Z order
|
|
-->
|
|
<GridSplitter Grid.Column="0" Grid.RowSpan="2" Width="5" />
|
|
<!-- Ladder Status message -->
|
|
<Button x:Name="_status" Grid.ColumnSpan="4" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Command="{Binding status_click_command}" Visibility="{Binding show_status_message, Converter={StaticResource BooleanToVisibilityConverter}}">
|
|
<Button.Template>
|
|
<ControlTemplate>
|
|
<TextBlock Text="{Binding status_message}" Background="{Binding status_background}" Padding="5,0" />
|
|
</ControlTemplate>
|
|
</Button.Template>
|
|
</Button>
|
|
</Grid>
|
|
</AdornerDecorator>
|
|
</UserControl>
|