PR suggestions

This commit is contained in:
Jake Norbut committed 2018-05-23 16:10:58 -05:00
1 parent c98559beb6
commit bbce4bd05c
1 file changed
+3 -4
@@ -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);
}
};