using Muchinfo.MTPClient.Account.ViewModels; using Muchinfo.MTPClient.Data.Enums; using Muchinfo.MTPClient.Data.Model; using Muchinfo.MTPClient.Infrastructure.Comparers; using Muchinfo.MTPClient.Infrastructure.Utilities; using System.Collections.Generic; using System.Linq; using System.Windows; using System.Windows.Controls; using System.Windows.Input; namespace Muchinfo.MTPClient.Account.Views { /// /// AccountManagerView.xaml 的交互逻辑 /// public partial class AccountManagerView : UserControl { public AccountManagerView() { InitializeComponent(); } /// /// Currents the goods. /// /// QuoteGoods. public List CurrentGoods() { var quoteGoodsList = new List(); if (UserManager.CurrentTradeAccount != null && UserManager.CurrentTradeAccount.AccountType != eUserType.USERTYPE_INVESTOR) { var position = UserManager.CacheOpenOrders(UserManager.CurrentTradeAccount); if (position == null || !position.Any()) return quoteGoodsList; var quote = position.Select((summary) => summary.QuoteGoods).Distinct(new QuoteGoodsComparer()); quoteGoodsList = new List(quote); } return quoteGoodsList; } private void Password_OnKeyUp(object sender, KeyEventArgs e) { //使用KeyUp,阻止键盘精灵弹出 e.Handled = true; } } }