Adding detach_command for easy binding

This commit is contained in:
Jake Norbut committed 2019-03-28 12:26:33 -05:00
1 parent 8716fff482
commit e4880a6715
1 file changed
+3
@@ -80,6 +80,7 @@ namespace mbts.spark {
send_attached_orders_cmd = send_attached_orders_async_cmd;
cancel_attach_orders_cmd = new DelegateCommand(() => is_attaching_algos = false);
begin_attach_command = new DelegateCommand(() => begin_attach_algos(), () => selected_rows.Count > 0);
detach_command = new DelegateCommand(() => detach_selected_algos(), () => selected_rows.Count > 0);
toggle_algo_editor_is_visible_cmd = new DelegateCommand(() => algo_editor_is_visible = !algo_editor_is_visible);
toggle_fills_slave_grid_is_visible_cmd = new DelegateCommand(() => fills_slave_grid_is_visible = !fills_slave_grid_is_visible);
grid_settings_manager = _create_grid_settings_manager(owner_title, bus, notification_service, model, rows, core_columns);
@@ -225,6 +226,7 @@ namespace mbts.spark {
public ICommand send_attached_orders_cmd { get; }
public ICommand cancel_attach_orders_cmd { get; }
public ICommand begin_attach_command { get; }
public ICommand detach_command { get; }
public ICommand toggle_algo_editor_is_visible_cmd { get; }
public ICommand toggle_fills_slave_grid_is_visible_cmd { get; }
public bool algo_editor_is_visible {
@@ -260,6 +262,7 @@ namespace mbts.spark {
}
RowSelectionHelper.apply_changes(selected_rows, e);
begin_attach_command.TryRaiseCanExecuteChanged();
detach_command.TryRaiseCanExecuteChanged();
selected_order_changed?.Invoke(current_order);
} catch(Exception ex) {
// [John]I observed a strange null-reference exception in this callback when the launcher was shutting down (see https://bluetradesys.atlassian.net/browse/SPARK-2089)