コード例 #1
0
        public ManageAccountsViewModel(ITradesContext tradesContext, IUpdateCachedData <Account> updateCachedData, ICachedData <Account> cachedData)
        {
            _tradesContext    = tradesContext;
            _updateCachedData = updateCachedData;
            _cachedData       = cachedData;

            _editAccountViewModel = new EditAccountViewModel(_tradesContext, _updateCachedData, _cachedData);
            _newAccountViewModel  = new NewAccountViewModel(_tradesContext);

            NewAccountVM.NewAccountAdd += EditAccountVM.OnNewAccountAdd;
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: luckdodgers/TradeStats
        public App()
        {
            _container = new UnityContainer();
            _container.Configure();

            _curAccountCache = _container.Resolve <IUpdateCachedData <Account> >();
            _tradesContext   = _container.Resolve <ITradesContext>();
            _logger          = _container.Resolve <ILogger>();

            InitOnAppStart();
        }
コード例 #3
0
        public CurrentAccountCache(ITradesContext context)
        {
            _context = context;

            CurrentAccount = _context.Accounts.FirstOrDefault(a => a.IsActive);
        }
コード例 #4
0
 public CurrentAccountTradeContext(ITradesContext context, ICachedData <Account> curAccountCache)
 {
     _context         = context;
     _curAccountCache = curAccountCache;
 }