diff --git a/src/client/spark/view/Spark/Ladder/LadderOrdersHost.cs b/src/client/spark/view/Spark/Ladder/LadderOrdersHost.cs index febf85c3f..602878333 100644 --- a/src/client/spark/view/Spark/Ladder/LadderOrdersHost.cs +++ b/src/client/spark/view/Spark/Ladder/LadderOrdersHost.cs @@ -112,14 +112,13 @@ namespace mbts.spark { // Hook up the style from xaml b.Style = this.TryFindResource(typeof(Badge)) as Style; b.MouseUp += (s, e) => { + var curr_order = b.DataContext as LadderOrderVM; if (e.ChangedButton == MouseButton.Middle) { - var curr_order = b.DataContext as LadderOrderVM; - if (curr_order != null && curr_order.modify_command.CanExecute(null)) { + if (curr_order?.modify_command?.CanExecute(null) == true) { curr_order.modify_command.Execute(null); } } else if (e.ChangedButton == MouseButton.Left) { - var curr_order = b.DataContext as LadderOrderVM; - if (curr_order?.modify_command?.CanExecute(null) == true) + if (curr_order?.cancel_command?.CanExecute(null) == true) curr_order.cancel_command.Execute(null); } };