private void SellButtonClick(object sender, RoutedEventArgs e) { var sellView = new SellView(); sellView.ShowDialog(); // Blocking //Update auctionlist this.Auctions = new ObservableCollection <Auction>(_auctionService.GetAll()); }
// Add-New-Auction Click Event Handler // Hier soll Add-New-Auction View geöffent werden private void NewAuctionBtn_Click(object sender, RoutedEventArgs e) { var addAuctionView = new SellView(); addAuctionView.ShowDialog(); // Update View var allAuctionsFromService = this.auctionService.GetAll(); this.Auctions = new ObservableCollection <Auction>(allAuctionsFromService); }
private void AddNewAuctionButtonClick(object sender, RoutedEventArgs e) { var sellView = new SellView(); sellView.ShowDialog(); // Blocking var allAuctionsFromService = this.auctionService.GetAll(); /* Option A: Full Update via INotifyPropertyChanged, not performant */ /* ================================================================ */ this.Auctions = new ObservableCollection <Auction>(allAuctionsFromService); /////* Option B: Let WPF only update the List and detect the additions */ /////* =============================================================== */ ////var toAdd = allAuctionsFromService.Where(a => !this.auctions.Contains(a)); ////foreach (var auction in toAdd) ////{ //// this.auctions.Add(auction); ////} }
private void SellButtonClick(object sender, RoutedEventArgs e) { var sellView = new SellView(); sellView.ShowDialog(); // Blocking }
public void OpenSellView(object sender, RoutedEventArgs e) { var sellView = new SellView(this.Auctions); sellView.ShowDialog(); }
private void NewAuction_Click(object sender, RoutedEventArgs e) { var sellView = new SellView(); sellView.ShowDialog(); // Blocking }