public ProductBasketViewModel(MessageBus messageBus, EventBus InputEventBus, ServerСommunication InputserverСommunication) { BindingOperations.EnableCollectionSynchronization(ProductsOnBasket, ObservableCollectionLocker); _serverСommunication = InputserverСommunication; _messageBus = messageBus; _eventBus = InputEventBus; SalesSystems.Add(new SellSystem() { id = 1, Name = "Talabat" }); SalesSystems.Add(new SellSystem() { id = 2, Name = "Zamato" }); SalesSystems.Add(new SellSystem() { id = 3, Name = "Uber" }); _messageBus.Receive <ProductModelMessage>(this, async InputProduct => { await Task.Run(() => { lock (ObservableCollectionLocker) ProductsOnBasket.Add(InputProduct.Product); }); }); if (ProductsOnBasket == null) { SendProductToBackApiIsEnabled = false; } else { SendProductToBackApiIsEnabled = true; } }
public ShowProductViewModel(ServerСommunication InputserverСommunication) { _serverСommunication = InputserverСommunication; }
public ShowLogViewModel(ServerСommunication InputserverСommunication) { _serverСommunication = InputserverСommunication; }