private void ListViewAvailable_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { CraftingActionContainer item = (sender as ListView)?.SelectedItem as CraftingActionContainer; if (item != null) { Sim.AddActions(true, item.Action); } }
private void Sim_FinishedStep(CraftingSim sim, int index) { if (index == 0) { if (CurrentActions != null) { CurrentActions.ForEach(x => x.Dispose()); CurrentActions.Clear(); } CurrentActions = new List <CraftingActionContainer>(); OldProgress = 0; OldQuality = 0; } var currentAction = sim.CraftingActions[index]; CraftingActionContainer container = new CraftingActionContainer(Sim, currentAction); container.ProgressIncreased = sim.CurrentProgress - OldProgress; container.QualityIncreased = sim.CurrentQuality - OldQuality; OldProgress = sim.CurrentProgress; OldQuality = sim.CurrentQuality; CurrentActions.Add(container); }