ladder - change menu buttons style

This commit is contained in:
John Colvin committed 2018-02-20 12:15:30 -05:00
1 parent 528690ab34
commit 1a984a3fda
4 files changed
+168 -60

No files matched your search

+2
View File
@@ -78,7 +78,9 @@ namespace mbts.ui
public static ImageSource Book { get { return (DrawingImage)_resources["Book"]; } }
public static ImageSource CancelOrders { get { return (DrawingImage)_resources["CancelOrders"]; } }
public static ImageSource CancelBuys { get { return (DrawingImage)_resources["CancelBuys"]; } }
public static ImageSource CancelBuysWhite { get { return (DrawingImage)_resources["CancelBuysWhite"]; } }
public static ImageSource CancelSells { get { return (DrawingImage)_resources["CancelSells"]; } }
public static ImageSource CancelSellsWhite { get { return (DrawingImage)_resources["CancelSellsWhite"]; } }
public static ImageSource CancelSelected { get { return (DrawingImage)_resources["CancelSelected"]; } }
public static ImageSource ModifyOrder { get { return (DrawingImage)_resources["Pencil"]; } }
+24
View File
@@ -573,6 +573,18 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="CancelBuysWhite">
<DrawingImage.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing
Brush="White"
Geometry="M -0.015625 0.01953125 L -0.015625 0.76953125 L -0.015625 24.841797 L 15.623047 24.841797 A 6.9657455 6.9657455 0 0 1 15.509766 24.644531 A 6.9657455 6.9657455 0 0 1 15.226562 24.009766 A 6.9657455 6.9657455 0 0 1 15.005859 23.349609 A 6.9657455 6.9657455 0 0 1 15.003906 23.341797 L 1.484375 23.341797 L 1.484375 1.5195312 L 23.345703 1.5195312 L 23.345703 14.720703 A 6.9657455 6.9657455 0 0 1 23.777344 14.830078 A 6.9657455 6.9657455 0 0 1 24.431641 15.070312 A 6.9657455 6.9657455 0 0 1 24.845703 15.269531 L 24.845703 0.01953125 L -0.015625 0.01953125 z M 7.2363281 4.4960938 L 7.2363281 20.271484 L 12.296875 20.271484 C 13.917734 20.271484 15.258806 19.853677 16.322266 19.017578 C 17.385725 18.181479 17.917969 17.087774 17.917969 15.738281 C 17.917969 14.652819 17.592197 13.772403 16.939453 13.097656 C 16.294043 12.415575 15.427259 12.013353 14.341797 11.888672 L 14.341797 11.84375 C 15.23657 11.56505 15.937299 11.095625 16.443359 10.435547 C 16.949419 9.7754687 17.203125 8.9982883 17.203125 8.1035156 C 17.203125 7.0327221 16.756101 6.1635061 15.861328 5.4960938 C 14.97389 4.8286814 13.765748 4.4960938 12.240234 4.4960938 L 7.2363281 4.4960938 z M 9.8417969 6.5957031 L 11.746094 6.5957031 C 13.550307 6.5957031 14.453125 7.2716006 14.453125 8.6210938 C 14.453125 9.4058534 14.192603 10.014548 13.671875 10.447266 C 13.158481 10.872649 12.44655 11.085938 11.537109 11.085938 L 9.8417969 11.085938 L 9.8417969 6.5957031 z M 9.8417969 13.185547 L 11.734375 13.185547 C 14.000643 13.185547 15.134766 14.003145 15.134766 15.638672 C 15.134766 16.430766 14.867428 17.055045 14.332031 17.509766 C 13.803969 17.957152 13.051621 18.181641 12.076172 18.181641 L 9.8417969 18.181641 L 9.8417969 13.185547 z M 19.478516 17.6875 C 19.365081 17.67151 19.258727 17.698367 19.185547 17.773438 L 17.128906 19.884766 C 16.982638 20.034993 17.024786 20.318597 17.224609 20.517578 L 19.544922 22.828125 L 17.207031 25.175781 C 17.008079 25.375646 16.969001 25.656373 17.119141 25.802734 L 19.230469 27.861328 C 19.380697 28.007596 19.6643 27.963502 19.863281 27.763672 L 22.173828 25.443359 L 24.521484 27.78125 C 24.721349 27.980202 25.002077 28.021237 25.148438 27.871094 L 27.207031 25.757812 C 27.353299 25.607585 27.309205 25.325934 27.109375 25.126953 L 24.789062 22.816406 L 27.126953 20.466797 C 27.325905 20.266932 27.364984 19.986205 27.214844 19.839844 L 25.103516 17.783203 C 24.953289 17.636935 24.671637 17.679084 24.472656 17.878906 L 22.162109 20.199219 L 19.8125 17.861328 C 19.71257 17.761848 19.591952 17.703494 19.478516 17.6875 z " />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="CancelSells">
<DrawingImage.Drawing>
<DrawingGroup>
@@ -585,6 +597,18 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="CancelSellsWhite">
<DrawingImage.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing
Brush="White"
Geometry="M -0.015625 0.01953125 L -0.015625 0.76953125 L -0.015625 24.841797 L 15.623047 24.841797 A 6.9657455 6.9657455 0 0 1 15.509766 24.644531 A 6.9657455 6.9657455 0 0 1 15.226562 24.009766 A 6.9657455 6.9657455 0 0 1 15.005859 23.349609 A 6.9657455 6.9657455 0 0 1 15.003906 23.341797 L 1.484375 23.341797 L 1.484375 1.5195312 L 23.345703 1.5195312 L 23.345703 14.720703 A 6.9657455 6.9657455 0 0 1 23.777344 14.830078 A 6.9657455 6.9657455 0 0 1 24.431641 15.070312 A 6.9657455 6.9657455 0 0 1 24.845703 15.269531 L 24.845703 0.01953125 L -0.015625 0.01953125 z M 12.318359 4.2304688 C 11.592273 4.2304688 10.880343 4.3200729 10.183594 4.4960938 C 9.4868446 4.6647804 8.8645183 4.9277335 8.3144531 5.2871094 C 7.7717222 5.6391511 7.3315139 6.0905599 6.9941406 6.640625 C 6.6641015 7.1833559 6.4980469 7.8256519 6.4980469 8.5664062 C 6.4980469 9.1678108 6.594467 9.6912856 6.7851562 10.138672 C 6.9831797 10.586058 7.2505173 10.990233 7.5878906 11.349609 C 7.9325981 11.701651 8.3348203 12.023038 8.796875 12.316406 C 9.2589297 12.609774 9.757572 12.899513 10.292969 13.185547 C 10.791694 13.412907 11.258688 13.633011 11.691406 13.845703 C 12.131458 14.051061 12.513233 14.268733 12.835938 14.496094 C 13.158642 14.723454 13.407964 14.975207 13.583984 15.253906 C 13.767339 15.525272 13.857422 15.848612 13.857422 16.222656 C 13.857422 16.919405 13.587653 17.451649 13.044922 17.818359 C 12.509525 18.185069 11.689974 18.367188 10.589844 18.367188 C 10.274473 18.367188 9.9306849 18.335539 9.5566406 18.269531 C 9.1825963 18.203523 8.807638 18.111488 8.4335938 17.994141 C 8.0595495 17.869459 7.7045608 17.71899 7.3671875 17.542969 C 7.0371484 17.366948 6.7517943 17.169245 6.5097656 16.949219 L 6.5097656 19.644531 C 6.7297917 19.783881 7.0195304 19.907565 7.3789062 20.017578 C 7.7382821 20.127591 8.1200564 20.219627 8.5234375 20.292969 C 8.9268186 20.373645 9.3178403 20.432079 9.6992188 20.46875 C 10.087931 20.512755 10.415656 20.535156 10.679688 20.535156 C 11.471781 20.535156 12.222176 20.458706 12.933594 20.304688 C 13.645011 20.150669 14.271722 19.901348 14.814453 19.556641 C 15.364518 19.211933 15.802295 18.764909 16.125 18.214844 C 16.447705 17.664779 16.609375 16.988881 16.609375 16.189453 C 16.609375 15.595383 16.499323 15.067523 16.279297 14.605469 C 16.066605 14.13608 15.772482 13.711457 15.398438 13.330078 C 15.031727 12.9487 14.60272 12.600527 14.111328 12.285156 C 13.627271 11.969786 13.110612 11.668846 12.560547 11.382812 C 12.02515 11.148118 11.55134 10.930445 11.140625 10.732422 C 10.737244 10.527064 10.393456 10.318161 10.107422 10.105469 C 9.8287222 9.8927769 9.615434 9.6590408 9.46875 9.4023438 C 9.322066 9.1456467 9.2480469 8.8403229 9.2480469 8.4882812 C 9.2480469 8.114237 9.344467 7.7952813 9.5351562 7.53125 C 9.7258455 7.2672187 9.9707821 7.0514991 10.271484 6.8828125 C 10.579521 6.7141259 10.925262 6.5928733 11.306641 6.5195312 C 11.695353 6.4461892 12.083944 6.4101562 12.472656 6.4101562 C 13.880823 6.4101562 15.031009 6.7315434 15.925781 7.3769531 L 15.925781 4.7929688 C 15.170358 4.4189245 13.968555 4.2304688 12.318359 4.2304688 z M 19.478516 17.6875 C 19.365081 17.67151 19.258727 17.698367 19.185547 17.773438 L 17.128906 19.884766 C 16.982638 20.034993 17.024786 20.318597 17.224609 20.517578 L 19.544922 22.828125 L 17.207031 25.175781 C 17.008079 25.375646 16.969001 25.656373 17.119141 25.802734 L 19.230469 27.861328 C 19.380697 28.007596 19.6643 27.963502 19.863281 27.763672 L 22.173828 25.443359 L 24.521484 27.78125 C 24.721349 27.980202 25.002077 28.021237 25.148438 27.871094 L 27.207031 25.757812 C 27.353299 25.607585 27.309205 25.325934 27.109375 25.126953 L 24.789062 22.816406 L 27.126953 20.466797 C 27.325905 20.266932 27.364984 19.986205 27.214844 19.839844 L 25.103516 17.783203 C 24.953289 17.636935 24.671637 17.679084 24.472656 17.878906 L 22.162109 20.199219 L 19.8125 17.861328 C 19.71257 17.761848 19.591952 17.703494 19.478516 17.6875 z " />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
<DrawingImage x:Key="CancelOrders">
<DrawingImage.Drawing>
<DrawingGroup>
+24 -36
View File
@@ -1,6 +1,5 @@
using bts.api;
using bts.api.orderman;
using bts.spark;
using mbts.co2;
using mbts.ui;
using mbts.ui.shell;
@@ -45,26 +44,10 @@ namespace mbts.spark {
_selected_time_in_force = backing(nameof(selected_order_type), TimeInForce.Day);
selected_order_type = _limit;
_revert = backing(nameof(revert), false);
show_ticket_command = new DelegateCommand(show_ticket);
send_order_command = new AsyncCommand<(double, Side?)>(send_order);
cancel_command = new AsyncCommand<LadderModel.CancelType>(_model.cancel_orders);
menu_items = new[] {
new SparkCommandVM(SparkCommand.create("Cxl Buys", Icons.CancelBuys, SparkTags.CancelOrders).complete(() => orders.Where(ovm => ovm.side == Side.Buy).Select(ovm => ovm.id)), _bus),
new SparkCommandVM(SparkCommand.create("Cxl Sells", Icons.CancelSells, SparkTags.CancelOrders).complete(() => orders.Where(ovm => ovm.side == Side.Sell).Select(ovm => ovm.id)), _bus),
new SparkCommandVM(SparkCommand.create("Cxl All", Icons.CancelOrders, SparkTags.CancelOrders).complete(() => orders.Select(ovm => ovm.id)), _bus),
new SparkCommandVM(SparkCommand.create("Details", Icons.Book, SparkTags.ShowOrderBookTag).complete(() => new bts.shell.OrderBookWindowFactory.OrderBookStartupData {
filters = new bts.shell.OrderBookWindowFactory.FilterStates {
security_criteria = new SecurityCriteria(security)
}
}), _bus),
//new SparkCommandVM(SparkCommands.ShowFills.complete(() => new bts.shell.FillsWindowFactory.StartupData(
// new bts.shell.FillsWindowFactory.FilterStates {
// security = new SecurityCriteria(security)
// }
//)), _bus),
new SparkCommandVM(SparkCommand.create("Ticket", Icons.Ticket, SparkTags.ShowOrderTicketTag).complete(() => (new OrderDefinitionImmutable(create_order()), 0d, 0u)), _bus)
};
show_book_command = new DelegateCommand(_show_book);
show_ticket_command = new DelegateCommand(_show_ticket);
// Settings
this.settings = settings;
_dispose = Disposable.Create(
@@ -92,7 +75,6 @@ namespace mbts.spark {
public IMDHandle md => _model.md;
public bool is_synthetic => _model.security.ContractCase == Security.ContractOneofCase.Synthetic;
public CalculatorLogic calculator { get; }
public SparkCommandVM[] menu_items { get; }
// until we design the grand BTS settings proto, the window factory will grab current_settings to save the state
public LadderSettings current_settings => _settings;
@@ -142,13 +124,24 @@ namespace mbts.spark {
#endregion
#region Orders
readonly IOrderTypeDefVM _market, _limit, _stop, _stop_limit, _iceberg, _time_box;
Property<bool> _revert;
Property<TimeInForce> _selected_time_in_force;
public bool revert { get => _revert.Value; set => _revert.set(value); }
public string[] accounts => _model.order_gateway.factory.accounts;
public string account { get => _order_template.Account; set => _order_template = _order_template.with(account: value); }
public TimeInForce[] time_in_forces => Enum.GetValues(typeof(TimeInForce)).Cast<TimeInForce>().ToArray();
public TimeInForce selected_time_in_force { get => _selected_time_in_force.Value; set => _selected_time_in_force.Value = value; }
public IOrderTypeDefVM[] order_types => new[] { _market, _limit, _stop, _stop_limit, _iceberg, _time_box };
public IOrderTypeDefVM selected_order_type { get; set; }
public ObservableCollection<OrderVM> orders { get; } = new ObservableCollection<OrderVM>();
public IAsyncCommand cancel_command { get; }
public IAsyncCommand send_order_command { get; }
public ICommand show_book_command { get; }
public ICommand show_ticket_command { get; }
internal void show_ticket() =>
_bus.post(SparkTags.ShowOrderTicketTag, (new OrderDefinitionImmutable(create_order()), 0d, 0u));
public async Task send_order((double price, Side? side) args) {
if (args.side.HasValue) {
if (!calculator.value.HasValue || calculator.value.Value == 0) {
@@ -172,20 +165,15 @@ namespace mbts.spark {
return mo;
}
Property<bool> _revert;
public bool revert { get => _revert.Value; set => _revert.set(value); }
void _show_book() =>
_bus.post(SparkTags.ShowOrderBookTag, new bts.shell.OrderBookWindowFactory.OrderBookStartupData {
filters = new bts.shell.OrderBookWindowFactory.FilterStates {
security_criteria = new SecurityCriteria(security)
}
});
public string[] accounts => _model.order_gateway.factory.accounts;
public string account { get => _order_template.Account; set => _order_template = _order_template.with(account: value); }
public TimeInForce[] time_in_forces => Enum.GetValues(typeof(TimeInForce)).Cast<TimeInForce>().ToArray();
Property<TimeInForce> _selected_time_in_force;
public TimeInForce selected_time_in_force { get => _selected_time_in_force.Value; set => _selected_time_in_force.Value = value; }
readonly IOrderTypeDefVM _market, _limit, _stop, _stop_limit, _iceberg, _time_box;
public IOrderTypeDefVM[] order_types => new[] { _market, _limit, _stop, _stop_limit, _iceberg, _time_box };
public IOrderTypeDefVM selected_order_type { get; set; }
public ObservableCollection<OrderVM> orders { get; } = new ObservableCollection<OrderVM>();
void _show_ticket() =>
_bus.post(SparkTags.ShowOrderTicketTag, (new OrderDefinitionImmutable(create_order()), 0d, 0u));
#endregion
#region Keyboard support
@@ -23,6 +23,83 @@
<Thickness Top="32" />
</converters:BooleanToObjectConverter.ValueForFalse>
</converters:BooleanToObjectConverter>
<Style x:Key="LadderMenuButton" TargetType="Button">
<Setter Property="Height" Value="28"/>
<Setter Property="Padding" Value="6,3"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
<Style x:Key="CancelBuys" TargetType="Button" BasedOn="{StaticResource LadderMenuButton}">
<Setter Property="Background" Value="{mbts:BTSColor MarketData.bid}"/>
<Setter Property="Content">
<Setter.Value>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="{x:Static mbts:Icons.CancelBuysWhite}" Height="20" HorizontalAlignment="Left"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" VerticalAlignment="Center" Foreground="White">Cxl Buys</TextBlock>
</Grid>
</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>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="{x:Static mbts:Icons.CancelSellsWhite}" Height="20" HorizontalAlignment="Left"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" VerticalAlignment="Center" Foreground="White">Cxl Sells</TextBlock>
</Grid>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CancelAll" TargetType="Button" BasedOn="{StaticResource LadderMenuButton}">
<Setter Property="Content">
<Setter.Value>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="{x:Static mbts:Icons.CancelOrders}" Height="20" HorizontalAlignment="Left"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" VerticalAlignment="Center">Cxl All</TextBlock>
</Grid>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ShowBook" TargetType="Button" BasedOn="{StaticResource LadderMenuButton}">
<Setter Property="Content">
<Setter.Value>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="{x:Static mbts:Icons.Book}" Width="21" HorizontalAlignment="Left"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" VerticalAlignment="Center">Details</TextBlock>
</Grid>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ShowTicket" TargetType="Button" BasedOn="{StaticResource LadderMenuButton}">
<Setter Property="Content">
<Setter.Value>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="{x:Static mbts:Icons.Ticket}" Height="20" HorizontalAlignment="Left"/>
<TextBlock Grid.Column="1" Margin="8,0,0,0" VerticalAlignment="Center">Ticket</TextBlock>
</Grid>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
@@ -32,33 +109,16 @@
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid Background="{mbts:BTSColor UI.spark_menu_background}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Margin="5,0">
<StackPanel.Resources>
<Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
</StackPanel.Resources>
<ComboBox Grid.ColumnSpan="2" Margin="2" ItemsSource="{Binding accounts}" SelectedItem="{Binding account}"/>
<ComboBox ItemsSource="{Binding time_in_forces}" SelectedItem="{Binding selected_time_in_force}" Margin="2"/>
<uag:OrderDetailsPopupControl ItemsSource="{Binding order_types}" SelectedItem="{Binding selected_order_type}" Margin="2" ExpandDirection="Left"/>
<!-- reset to defaults after order -->
<CheckBox Margin="2" IsChecked="{Binding revert}">Revert</CheckBox>
<TextBox HorizontalContentAlignment="Right" Text="{Binding calculator.value}" Margin="2,15,2,2"/>
<ItemsControl ItemsSource="{Binding calculator.buttons}" Focusable="False">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="2" Focusable="False"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Margin="2" Command="{Binding Path=DataContext.calculator.click, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding}" Content="{Binding}" Focusable="False"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Button Margin="2" HorizontalAlignment="Stretch" Command="{Binding calculator.clear}">Clear</Button>
<controls:SparkMenu ItemsSource="{Binding menu_items}" ShowText="True"/>
<Grid Margin="8,4,0,0" Visibility="{Binding is_synthetic,Converter={StaticResource BoolToInVisibility}}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@@ -88,14 +148,48 @@
<TextBlock Grid.Column="2" Grid.Row="4" Text="{Binding low, Mode=OneWay}" Foreground="{mbts:BTSColor danger}" FontWeight="Bold" />
<TextBlock Grid.Column="2" Grid.Row="6" Text="{Binding open, Mode=OneWay}" FontWeight="Bold" />
<TextBlock Grid.Column="2" Grid.Row="8" Text="{Binding volume, Mode=OneWay}" FontWeight="Bold" />
<spark:RecenterCountdown Grid.ColumnSpan="3" Grid.Row="9"
Width="16" Height="16" Margin="6"
<!--<spark:RecenterCountdown Grid.ColumnSpan="3" Grid.Row="9"
Width="16" Height="16" Margin="6,6,6,0"
HorizontalAlignment="Center"
Command="{Binding RecenterCommand, ElementName=_ladder}"
Foreground="Black" Background="Transparent" BorderBrush="Transparent" BorderThickness="0"
PieBackground="Black" SliceBackground="White" />
PieBackground="Black" SliceBackground="White" />-->
</Grid>
<ComboBox Margin="2,10,2,2" ItemsSource="{Binding accounts}" SelectedItem="{Binding account}"/>
<ComboBox ItemsSource="{Binding time_in_forces}" SelectedItem="{Binding selected_time_in_force}" Margin="2"/>
<uag:OrderDetailsPopupControl ItemsSource="{Binding order_types}" SelectedItem="{Binding selected_order_type}" Margin="2" ExpandDirection="Left"/>
<!-- reset to defaults after order -->
<CheckBox Margin="2" IsChecked="{Binding revert}">Revert</CheckBox>
<TextBox HorizontalContentAlignment="Right" Text="{Binding calculator.value}" Margin="2,0,2,2"/>
<ItemsControl ItemsSource="{Binding calculator.buttons}" Focusable="False">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="2" Focusable="False"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Margin="2" Command="{Binding Path=DataContext.calculator.click, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding}" Content="{Binding}" Focusable="False"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Button Margin="2" HorizontalAlignment="Stretch" Command="{Binding calculator.clear}">Clear</Button>
<StackPanel Margin="2,12,2,0">
<Button Command="{Binding cancel_command}" CommandParameter="Bids" Style="{StaticResource CancelBuys}"/>
<Button Command="{Binding cancel_command}" CommandParameter="Asks" Style="{StaticResource CancelSells}" Margin="0,5,0,0"/>
<Button Command="{Binding cancel_command}" CommandParameter="All" Style="{StaticResource CancelAll}" Margin="0,5,0,0"/>
</StackPanel>
<!--<controls:SparkMenu Margin="0,8,0,0" ItemsSource="{Binding menu_items}" ShowText="True"/>-->
</StackPanel>
<Grid Grid.Row="1" Margin="5,12" VerticalAlignment="Bottom">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Button Command="{Binding show_book_command}" Style="{StaticResource ShowBook}"/>
<Button Grid.Row="1" Command="{Binding show_ticket_command}" Style="{StaticResource ShowTicket}" Margin="0,5,0,0"/>
</Grid>
</Grid>
<Rectangle Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Fill="{mbts:BTSColor UI.form_content_border}"/>
<spark:LadderGridHost x:Name="_ladder" Grid.Column="2" Command="{Binding send_order_command}" Orders="{Binding orders}">