public void AddExecuteChanged()
        {
            AutoStopLossModelViewModel aslmv = new AutoStopLossModelViewModel();

            aslmv.Variety = TransactionViewModel.Instance().Variety;
            Aslmvm.Add(aslmv);
        }
 public void DeleteExecuteChanged()
 {
     if (SelectedItem == null)
     {
         MessageBox.Show("请选择删除的行!", "提示");
         return;
     }
     Aslmvm.Remove(SelectedItem);
 }
        private void LoadPara()
        {
            StopLossModelViewModel.BuyNum             = CommParameterSetting.StopLossModel.BuyNum;
            StopLossModelViewModel.CkBuy              = CommParameterSetting.StopLossModel.CkBuy;
            StopLossModelViewModel.CkSell             = CommParameterSetting.StopLossModel.CkSell;
            StopLossModelViewModel.SellNum            = CommParameterSetting.StopLossModel.SellNum;
            StopLossModelViewModel.StopLossDelegation = CommParameterSetting.StopLossModel.StopLossDelegation;
            StopLossModelViewModel.StopLossPrice      = CommParameterSetting.StopLossModel.StopLossPrice;
            // comStopProfit.Text = CommParameterSetting.StopLossModel.StopProfitPrice;
            //加载自动止盈止损 自动盈亏是用;分割行,分割列;
            if (CommParameterSetting.AutoStopLossModel != null && CommParameterSetting.AutoStopLossModel.Count > 0)
            {
                foreach (AutoStopLossModel item in CommParameterSetting.AutoStopLossModel)
                {
                    AutoStopLossModelViewModel asmvm = new AutoStopLossModelViewModel();
                    asmvm.VarietySelectedItem   = item.Variety;
                    asmvm.Agreement             = item.Agreement;
                    asmvm.Direction             = item.Direction == "B"? "买":"卖";
                    asmvm.FloatingProfitAndLoss = item.FloatingProfitAndLoss;
                    asmvm.StopLossPotion        = item.StopLossPotion;
                    asmvm.StopProfitPotion      = item.StopProfitPotion;
                    asmvm.Variety      = TransactionViewModel.Instance().Variety;
                    asmvm.ContractCode = MainViewModel.GetInstance().VarietyList[asmvm.VarietySelectedItem].ToList();
                    Aslmvm.Add(asmvm);
                }
            }
            //下单版设置
            OrderVersion.BeforeOrderEnter = CommParameterSetting.OrderVersion.BeforeOrderEnter;
            OrderVersion.DefaultLot       = CommParameterSetting.OrderVersion.DefaultLot;
            OrderVersion.MaxLot           = CommParameterSetting.OrderVersion.MaxLot;


            //快捷键设置
            ShortcutKey.LockMenu    = CommParameterSetting.ShortcutKey.LockMenu;
            ShortcutKey.BuyOpen     = CommParameterSetting.ShortcutKey.BuyOpen;
            ShortcutKey.Clearance   = CommParameterSetting.ShortcutKey.Clearance;
            ShortcutKey.ClosingBuy  = CommParameterSetting.ShortcutKey.ClosingBuy;
            ShortcutKey.ClosingSell = CommParameterSetting.ShortcutKey.ClosingSell;
            ShortcutKey.Revoke      = CommParameterSetting.ShortcutKey.Revoke;
            ShortcutKey.SellOpen    = CommParameterSetting.ShortcutKey.SellOpen;
            //消息提示
            MessageAlert.OrderAlert  = CommParameterSetting.MessageAlert.OrderAlert;
            MessageAlert.RevokeAlert = CommParameterSetting.MessageAlert.RevokeAlert;
            MessageAlert.TradeAlert  = CommParameterSetting.MessageAlert.TradeAlert;
        }