public TradePanelViewModel(MainViewModel mainVM) { _mainVM = mainVM; TransactionViewModel = TransactionViewModel.Instance(); TransactionPannel = new TransactionPannelViewModel(); ConditionBill = UCConditionBillViewModel.Instance(); PositionAll = PositionAllViewModel.Instance(); OrderCancel = OrderCancelViewModel.Instance(); TodayTrader = TodayTraderViewModels.Instance(); FundsViewModel = FundsViewModel.GetInstance(); }
public void ClearTradeList() { PositionAllViewModel.Instance().DetPMList.Clear(); PositionAllViewModel.Instance().PMList.Clear(); PositionViewModel.Instance().PMList.Clear(); OrderCancelViewModel.Instance().KCDelegations.Clear(); OrderCancelViewModel.Instance().Delegations.Clear(); UCConditionBillViewModel.Instance().ConditionBillList.Clear(); TodayTraderViewModels.Instance().TodayTraderList.Clear(); }
private void SendOrderCancel(bool isClear = true) { ReqPotion rpd = new ReqPotion(); rpd.cmdcode = RequestCmdCode.SelectOrderCancel; rpd.content = new ReqLoginName() { user_id = UserInfoHelper.UserId }; ScoketManager.GetInstance().SendTradeWSInfo(JsonConvert.SerializeObject(rpd)); if (isClear) { OrderCancelViewModel.Instance().KCDelegations.Clear(); OrderCancelViewModel.Instance().Delegations.Clear(); } }
private void Border_MouseLeftButtonDown_9(object sender, MouseButtonEventArgs e) { OrderCancelViewModel.Instance().Sorting("ShadowOrderID", isShadowOrderID); isShadowOrderID = !isShadowOrderID; }
private void Window_PreviewKeyDown(object sender, KeyEventArgs e) { if (ContractVariety.IsLoginSuccess) { if ((int)e.Key == CommParameterSetting.ShortcutKey.IntBuyOpen && CommParameterSetting.ShortcutKey.IntBuyOpen != 0) { if (viewModel.SelectItemViewModel == null) { MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning); return; } TransactionViewModel.Instance().SJBuyExecuteChanged(); } else if ((int)e.Key == CommParameterSetting.ShortcutKey.IntClearance && CommParameterSetting.ShortcutKey.IntClearance != 0) { if (viewModel.SelectItemViewModel == null) { MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning); return; } PositionViewModel.Instance().TradeAllExecuteChanged(); } else if ((int)e.Key == CommParameterSetting.ShortcutKey.IntClosingBuy && CommParameterSetting.ShortcutKey.IntClosingBuy != 0) { if (viewModel.SelectItemViewModel == null) { MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning); return; } TransactionViewModel.Instance().IsByClose = false; TransactionViewModel.Instance().IsSellClose = true; TransactionViewModel.Instance().BuyExecuteChanged(); } else if ((int)e.Key == CommParameterSetting.ShortcutKey.IntClosingSell && CommParameterSetting.ShortcutKey.IntClosingSell != 0) { if (viewModel.SelectItemViewModel == null) { MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning); return; } TransactionViewModel.Instance().IsSellClose = true; TransactionViewModel.Instance().IsByClose = false; TransactionViewModel.Instance().SellExecuteChanged(); } else if ((int)e.Key == CommParameterSetting.ShortcutKey.IntRevoke && CommParameterSetting.ShortcutKey.IntRevoke != 0) { if (viewModel.SelectItemViewModel == null) { MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning); return; } OrderCancelViewModel.Instance().SelectedItem = OrderCancelViewModel.Instance().Delegations.FirstOrDefault(x => x.ContractID == viewModel.SelectItemViewModel.ContractCode); if (OrderCancelViewModel.Instance().SelectedItem == null) { return; } OrderCancelViewModel.Instance().OrderCancelExecuteChanged(); } else if ((int)e.Key == CommParameterSetting.ShortcutKey.IntSellOpen && CommParameterSetting.ShortcutKey.IntSellOpen != 0) { if (viewModel.SelectItemViewModel == null) { MessageBox.Show("请锁定合约", "提示", MessageBoxButton.OK, MessageBoxImage.Warning); return; } TransactionViewModel.Instance().SJSellExecuteChanged(); } // Window_KeyUp(sender, e); } if (UserInfoHelper.IsHaveLogin) { Window_KeyUp(sender, e); } }
private void Border_MouseLeftButtonDown_8(object sender, MouseButtonEventArgs e) { OrderCancelViewModel.Instance().Sorting("OrderTime", isOrderTime); isOrderTime = !isOrderTime; }
private void Border_MouseLeftButtonDown_3(object sender, MouseButtonEventArgs e) { OrderCancelViewModel.Instance().Sorting("OrderStatus", isOrderStatus); isOrderStatus = !isOrderStatus; }
private void Border_MouseLeftButtonDown_2(object sender, MouseButtonEventArgs e) { OrderCancelViewModel.Instance().Sorting("OpenOffset", isOpenOffset); isOpenOffset = !isOpenOffset; }
private void Border_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e) { OrderCancelViewModel.Instance().Sorting("Direction", isDirection); isDirection = !isDirection; }
private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { OrderCancelViewModel.Instance().Sorting("ContractCode", isContractCode); isContractCode = !isContractCode; }