public GoldProducerViewModel(RessourceProducer ressourceProducer) { this.RessourceProducer = ressourceProducer; this.View = new GoldProducerUC(); this.View.DataContext = this.RessourceProducer; EventsGenerator(); }
private GoldProducersViewModel(RessourceProducer ressourceProducer) { view = new GoldProducerUserControl(this); RessourceProducer = ressourceProducer; EventsGenerator(); view.DataContext = RessourceProducer; }
private GoldProducersViewModelOld(RessourceProducer ressourceProducer) { view = new GoldProducerUserControl(this); RessourceProducer = ressourceProducer; EventsGenerator(); view.DataContext = this; view.BuildingNameLabel.DataContext = RessourceProducer; }
private void UsineTwoButton_Click(object sender, System.Windows.RoutedEventArgs e) { if (producer2 == null) { Task <RessourceProducer> newProducer = RecupProducer(2); producer2 = newProducer.Result; } GoldProducersViewModel popUp = GoldProducersViewModel.GetProducersViewModelMultition(producer2); popUp.view.Visibility = System.Windows.Visibility.Visible; }
public static GoldProducersViewModel GetProducersViewModelMultition(RessourceProducer Key) { lock (_lock) { if (!_instances.ContainsKey(Key)) { _instances.Add(Key, new GoldProducersViewModel(Key)); } return(_instances[Key]); } }
private void UsineOneButton_Click(object sender, System.Windows.RoutedEventArgs e) { if (producer == null) { Task <RessourceProducer> newProducer = RecupProducer(1); producer = newProducer.Result; } GoldProducersViewModel popUp = GoldProducersViewModel.GetProducersViewModelMultition(producer); if (producer.IsActive == true) { popUp.view.MainGrid.Background = Brushes.Green; } popUp.view.Visibility = System.Windows.Visibility.Visible; }
public static GoldProducersViewModelOld GetProducersViewModelMultition(RessourceProducer Key) { lock (_lock) { if (!_instances.ContainsKey(Key)) { _instances.Add(Key, new GoldProducersViewModelOld(Key)); } if (_instances[Key].RessourceProducer.IsActive == true) { _instances[Key].RefreshView(); } return(_instances[Key]); } }
private async Task <RessourceProducer> RecupProducer(int idToRecup) { RessourceProducer producerToReturn = await mySQLManager.Get(idToRecup); return(producerToReturn); }