minor refactoring, some notes after talking w/ john

This commit is contained in:
Jake Norbut authored and Pedro Pinto committed 2019-02-11 16:50:35 -05:00
1 parent 4f5f4c61f3
commit c91eedcca0
4 files changed
+10 -6

No files matched your search

@@ -668,9 +668,9 @@ namespace mbts.spark {
public class CancelColumn : FrameworkElementColumnBase<Columns> {
readonly BindingBase _command_binding;
public CancelColumn(Columns key, string command_property) : base(key) {
public CancelColumn(string command_property) : base(Columns.Cancel) {
id = key.ToString();
Header = DefaultColumnHeaders.Delete;
Header = DefaultColumnHeaders.Cancel;
_command_binding = new Binding(command_property);
}
@@ -132,7 +132,7 @@ namespace mbts.spark {
(desired_quantity) => _owner.modify_order_quantity(this, (uint)desired_quantity),
(desired_quantity) =>
(desired_quantity != null && this.status == OrderStatus.Working && (uint)desired_quantity != this.quantity)
|| prospective_quantity != this.quantity
|| is_qty_dirty
)
);
@@ -141,7 +141,7 @@ namespace mbts.spark {
(desired_price) => _owner.modify_order_price(this, (double)desired_price),
(desired_price) =>
(desired_price != null && this.status == OrderStatus.Working && (double)desired_price != this.price)
|| prospective_price != this.price
|| is_price_dirty
)
);
@@ -98,7 +98,7 @@ namespace mbts.ui.controls {
TotalNetPos = "Total Net Pos",
TotalPnL = "Total PnL",
PnLPrice = "PnL Price",
Delete = "Delete";
Cancel = "Cancel";
}
public interface IKeyedColumn<TColKey> {
@@ -213,7 +213,11 @@ namespace mbts.spark {
bts.shell.OrderBookWindowFactory.OrderBookStartupData.default_mini_grid,
use_defaults: false
);
obvm.columns.Insert(0, new OrderBookVM.CancelColumn(OrderBookView.Columns.Cancel, nameof(OrderBookRowVM.cancel_command)));
// NOTE:
// we might need the ObservableAppend to InsertAt
// if these EditXXX ever support settings.
// insert the cancel column
obvm.columns.Insert(0, new OrderBookVM.CancelColumn(nameof(OrderBookRowVM.cancel_command)));
var qty_col = obvm.columns.Where(x => x.id == OrderBookView.Columns.Size.ToString()).FirstOrDefault();
var qty_index = obvm.columns.indexOf(qty_col);
if (qty_index > -1) {