using GalaSoft.MvvmLight.Ioc; using Microsoft.Practices.ServiceLocation; using Muchinfo.MTPClient.Account.ViewModels; using Muchinfo.MTPClient.Account.ViewModels.AllOrderViewModel; using Muchinfo.MTPClient.Account.ViewModels.OrderViewModel; using Muchinfo.MTPClient.Analysis.ViewModels; using Muchinfo.MTPClient.Bank.ViewModels; using Muchinfo.MTPClient.Delivery.ViewModels; using Muchinfo.MTPClient.IService; using Muchinfo.MTPClient.Listing.ViewModel; using Muchinfo.MTPClient.Quotation.ViewModels; using Muchinfo.MTPClient.Sale.ViewModels; using Muchinfo.MTPClient.Service; using Muchinfo.MTPClient.Trade.ViewModels; using Muchinfo.MTPClient.UI.ViewModels; using Muchinfo.MTPClient.UI.Views; namespace Muchinfo.MTPClient.UI { public class ViewModelLocator { public static void Initialize() { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); // 注册服务 RegisterServices(); //注册ViewModel RegisterViewModels(); RegisterView(); } private static void RegisterView() { SimpleIoc.Default.Register(); } /// /// 注册服务 /// private static void RegisterServices() { SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register();//new 2.0 SimpleIoc.Default.Register();//new 2.0 } /// /// 注册ViewModel /// private static void RegisterViewModels() { SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); //SimpleIoc.Default.Register(); //SimpleIoc.Default.Register(); //SimpleIoc.Default.Register(); //SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register (); //预埋单查询 SimpleIoc.Default.Register(); //预埋单查询-不区分市场 SimpleIoc.Default.Register(); //配号中签 SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); //交割申报 //SimpleIoc.Default.Register(); //交割仓单查询 SimpleIoc.Default.Register(); //交割配对查询 SimpleIoc.Default.Register(); //交割-提货-查询 SimpleIoc.Default.Register(); //交割-提货-申请 SimpleIoc.Default.Register(); //交割 成交单 SimpleIoc.Default.Register(); ///资金流水查询 SimpleIoc.Default.Register(); ////协议平仓 SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); ////行情列表 SimpleIoc.Default.Register(); ////签约查询 SimpleIoc.Default.Register(); ////历史单据查询 SimpleIoc.Default.Register(); ////查询交割商品 SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); SimpleIoc.Default.Register(); ////五档历史 SimpleIoc.Default.Register(); } /// /// Cleanups this instance. /// public static void Cleanup() { } #region ViewModels /// /// 只有一个实例,在RegisterViewModels()里注册后使用ServiceLocator /// public static HomeViewModel Home { get { return ServiceLocator.Current.GetInstance(); } } /// /// 报价牌 ,k线 /// public static MainContentViewModel MainContent { get { return ServiceLocator.Current.GetInstance(); } } /// /// 主窗口 /// public static MainPage MainPage { get { return ServiceLocator.Current.GetInstance(); } } /// /// 交易信息管理 /// public static AccountManagerViewModel AccountManager { get { return ServiceLocator.Current.GetInstance(); } } #region 旧单据查询 /// /// 账号信息 /// //public static AccountInfoListViewModel AccountInfo //{ // get // { // return ServiceLocator.Current.GetInstance(); // } //} ///// ///// 持仓单 ///// //public static HoldingDetailListViewModel HoldingReport //{ // get { return ServiceLocator.Current.GetInstance(); } //} ///// /////平仓单 ///// //public static CloseOrderListViewModel CloseOrderList //{ // get { return ServiceLocator.Current.GetInstance(); } //} ///// ///// 持仓汇总 ///// //public static HoldingSummaryListViewModel HoldingSummary //{ // get { return ServiceLocator.Current.GetInstance(); } //} ///// ///// 成交单 ///// //public CompleteOrderViewModel CompleteOrders //{ // get { return ServiceLocator.Current.GetInstance(); } //} #endregion #region 新单据查询 /// /// 账号信息 /// public static MAccountInfoViewModel MAccountInfo { get { return ServiceLocator.Current.GetInstance(); } } /// /// 持仓单 /// public static MHoldDetailViewModel MHoldingDetail { get { return ServiceLocator.Current.GetInstance(); } } /// /// 持仓单-不区分市场 /// public static MOHoldDetailViewModel MOHoldingDetail { get { return ServiceLocator.Current.GetInstance(); } } /// ///平仓单 /// public static MCloseOrderViewModel MCloseOrders { get { return ServiceLocator.Current.GetInstance(); } } /// ///平仓单[成交明细]-不区分市场 /// public static MOTransactionDetailViewModel MOCloseOrders { get { return ServiceLocator.Current.GetInstance(); } } /// /// 持仓汇总 /// public static MHoldSummaryViewModel MProsition { get { return ServiceLocator.Current.GetInstance(); } } /// /// 持仓汇总-不区分市场 /// public static MOHoldSummaryViewModel MOProsition { get { return ServiceLocator.Current.GetInstance(); } } /// ///委托单 /// public static MOrderDetailViewModel MOrderDetails { get { return ServiceLocator.Current.GetInstance(); } } /// ///委托单-不区分市场 /// public static MOOrderDetailViewModel MOOrderDetails { get { return ServiceLocator.Current.GetInstance(); } } /// /// 建仓单 /// public MOpenCompleteViewModel MCompleteOrders { get { return ServiceLocator.Current.GetInstance(); } } /// /// 预埋单查询 /// public PrePostDetailViewModel PrePostDetail { get { return ServiceLocator.Current.GetInstance(); } } /// /// 预埋单查询-不区分市场 /// public MOPrePostDetailViewModel OPrePostDetail { get { return ServiceLocator.Current.GetInstance(); } } /// /// 配号中签查询 /// public DistributeBallotViewModel DistributeBallot { get { return ServiceLocator.Current.GetInstance(); } } /// /// 交割申报 /// public DeliveryOrderViewModel DeliveryOrderView { get { return ServiceLocator.Current.GetInstance(); } } /// /// /资金流水查询 /// public TaAmountLogViewModel TaAmountLog { get { return ServiceLocator.Current.GetInstance(); } } public MOSPSLListViewModel SPSLListViewModel { get { return ServiceLocator.Current.GetInstance(); } } #endregion /// /// 快速下单栏 /// public QuickOrderViewModel OrderBar { get { return ServiceLocator.Current.GetInstance(); } } public static StatusBarViewModel StatusBar { get { return ServiceLocator.Current.GetInstance(); } } /// /// 菜单树 /// public static MenuTreeViewModel MenuTree { get { return ServiceLocator.Current.GetInstance(); } } /// /// 行情列表 /// public static QuoteListViewModel QuoteList { get { return ServiceLocator.Current.GetInstance(); } } public static TradeHeaderViewModel TradeHeader { get { return ServiceLocator.Current.GetInstance(); } } public static Muchinfo.MTPClient.Bank.ViewModels.AmountQueryViewModel AmountQuery { get { return ServiceLocator.Current.GetInstance(); } } /// /// 查询发售商品 /// public static QuerySaleGoodsViewModel QuerySaleGoods { get { return ServiceLocator.Current.GetInstance(); } } /// /// 挂牌市场 /// public static ListingMarketViewModel ListingMarket { get { return ServiceLocator.Current.GetInstance(); } } public static DelistingOrderViewModel DelistingViewModel { get { return ServiceLocator.Current.GetInstance(); } } /// /// 查询交割单 /// public static DeliveryHolderViewModel DeliveryHolder { get { return ServiceLocator.Current.GetInstance(); } } /// /// 交割申报单 /// public static DeliveryEntructViewModel DeliveryEntruct { get { return ServiceLocator.Current.GetInstance(); } } /// /// 交割仓单查询 /// public static DeliveryWarehouseOrderViewModel DeliveryWarehouseOrder { get { return ServiceLocator.Current.GetInstance(); } } /// /// 交割配对仓单查询 /// public static DeliveryMatchViewModel DeliveryMatch { get { return ServiceLocator.Current.GetInstance(); } } /// /// 交割提货-查询 /// public static TakaDeliveryGoodsQueryViewModel TakaDeliveryGoodsQuery { get { return ServiceLocator.Current.GetInstance(); } } /// /// 交割提货-申请 /// public static TakaDeliveryGoodsApplyViewModel TakaDeliveryGoodsApply { get { return ServiceLocator.Current.GetInstance(); } } public static DeliveryCompleteViewModel DlyCompleteViewModel { get { return ServiceLocator.Current.GetInstance(); } } #endregion /// /// /协议平仓 /// public DealCloseViewModel DealClose { get { return ServiceLocator.Current.GetInstance(); } } /// /// 托管申请查询 /// public QueryDepositApplyViewModel DepositQuery { get { return ServiceLocator.Current.GetInstance(); } } /// /// /签约查询 /// public BankSignQueryViewModel BankSignQuery { get { return ServiceLocator.Current.GetInstance(); } } /// /// 历史单据查询 /// public HistoryOrderQueryViewModel HistoryOrder { get { return ServiceLocator.Current.GetInstance(); } } /// /// 挂牌点价 /// public static ListingDeliveryGoodsViewModel ListingDeliveryGoodses { get { return ServiceLocator.Current.GetInstance(); } } /// /// 我的挂牌 /// public static MyListingOrderViewModel MyListingOrder { get { return ServiceLocator.Current.GetInstance(); } } /// /// 五档历史 /// public static HistoryCommissionsListViewModel HistoryCommissionsList { get { return ServiceLocator.Current.GetInstance(); } } /// /// 我的订单 /// public static MyOrderViewModel MyOrder { get { return ServiceLocator.Current.GetInstance(); } } } }