private void checkBox_Checked(object sender, RoutedEventArgs e) { //var quote = FastOrderContract.Text; //var item = MessageHandlerContainer.DefaultInstance.Get<MarketDataHandler>().SubMarketData(quote); //if (!string.IsNullOrEmpty(FastOrderContract.Text)) //{ //checkBox.IsEnabled = true; if (OrderVM.Direction == DirectionType.BUY) { LimitTxt.SetBinding(DoubleUpDown.ValueProperty, new Binding("AskPrice.Value") { Mode = BindingMode.OneWay }); LimitTxt.Increment = null; } else if (OrderVM.Direction == DirectionType.SELL) { LimitTxt.SetBinding(DoubleUpDown.ValueProperty, new Binding("BidPrice.Value") { Mode = BindingMode.OneWay }); LimitTxt.Increment = null; } //} //else // checkBox.IsEnabled = false; }
private void SellChecked(object sender, RoutedEventArgs e) { if (checkBox.IsChecked.Value) { LimitTxt.SetBinding(DoubleUpDown.ValueProperty, new Binding("BidPrice.Value") { Mode = BindingMode.OneWay }); } else if (LabelBidPrice.Content != null) { LimitTxt.Value = double.Parse(LabelBidPrice.Content.ToString()); } }
private async void LoadContract() { if (FastOrderContract.SelectedItem == null) { FastOrderContract.SelectedItem = FastOrderContract.Filter ?? string.Empty; } var contract = FastOrderContract.SelectedItem.ToString(); if (FutureContractList.Any(c => c.Contract == contract)) { OrderVM.Contract = contract; var quote = OrderVM.Contract; var item = await MarketDataHandler.SubMarketDataAsync(quote); if (item != null) { stackPanelPrices.DataContext = item; var contractInfo = ClientDbContext.FindContract(quote); LimitTxt.Increment = contractInfo == null ? 1 : contractInfo.PriceTick; checkBox.IsEnabled = true; radioButtonBuy.IsChecked = true; //radioButtonSell.IsChecked = false; RadioA.IsChecked = true; //RadioB.IsChecked = false; //RadioC.IsChecked = false; LimitTxt.SetBinding(DoubleUpDown.ValueProperty, new Binding("AskPrice.Value") { Mode = BindingMode.OneWay }); } } else { checkBox.IsChecked = false; checkBox.IsEnabled = false; } }