public MainViewModel(IAuctioneer auctioneer, IAuctionService auctionService) { this.auctioneer = auctioneer; this.auctionService = auctionService; this.AddNewAuctionCommand = new RelayCommand(this.AddNewAuctionAction); // Register for Events this.auctioneer.AuctionEnded += (sender, args) => { this.ApplyChanges(args.Auction); }; this.auctioneer.AuctionStarted += (sender, args) => { this.ApplyChanges(args.Auction); }; this.auctioneer.BidAccepted += (sender, args) => { this.ApplyChanges(args.Auction); }; this.auctioneer.BidDeclined += (sender, args) => { this.ApplyChanges(args.Auction); }; // Setup UI var allAuctions = this.auctionService.GetAll(); foreach (var auction in allAuctions) { var auctionVm = new AuctionViewModel(auction); this.auctions.Add(auctionVm); } }
public MainViewModel(IAuctioneer auctioneer, IAuctionService auctionService) { this.auctioneer = auctioneer; this.auctionService = auctionService; this.AddNewAuctionCommand = new RelayCommand(this.AddNewAuctionAction); // Register for Events this.auctioneer.AuctionEnded += (sender, args) => { this.ApplyChanges(args.Auction); }; this.auctioneer.AuctionStarted += (sender, args) => { this.ApplyChanges(args.Auction); }; this.auctioneer.BidAccepted += (sender, args) => { this.ApplyChanges(args.Auction); }; this.auctioneer.BidDeclined += (sender, args) => { this.ApplyChanges(args.Auction); }; // Setup UI var allAuctions = this.auctionService.GetAll().ToList(); foreach (var auction in allAuctions) { var auctionVm = new AuctionViewModel(auction); this.auctions.Add(auctionVm); } }
public MainViewModel(IAuctioneer auctioneer, IAuctionService auctionService) { var ensureDLLIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance; this.auctionService = auctionService; auctions = new ObservableCollection <AuctionViewModel>(); // register for events auctioneer.AuctionEnded += (sender, args) => { ApplyChanges(args.Auction); }; auctioneer.AuctionStarted += (sender, args) => { ApplyChanges(args.Auction); }; auctioneer.BidAccepted += (sender, args) => { ApplyChanges(args.Auction); }; auctioneer.BidDeclined += (sender, args) => { ApplyChanges(args.Auction); }; // populate auctions list var allAuctions = auctionService.GetAll(); foreach (var auction in allAuctions) { var auctionVm = new AuctionViewModel(auction); Auctions.Add(auctionVm); } }
public AuctionController(IUnitOfWork unitOfWork, IAuctioneer auctioneer) { this.unitOfWork = unitOfWork; this.auctioneer = auctioneer; }