private void Mc_DeleteRequested(object sender, EventArgs e) { MachineControl machine = sender as MachineControl; ContainingProject.DFAMachines.Remove(machine.ContainingMachine); InvalidateMachinesGrid(); }
public void InvalidateMachinesGrid() { MachinesGrid.Children.Clear(); foreach (DFAMachine machine in ContainingProject.DFAMachines) { MachineControl mc = new MachineControl(machine); mc.DeleteRequested += Mc_DeleteRequested; MachinesGrid.Children.Add(mc); } foreach (TuringMachine machine in ContainingProject.TuringMachines) { TuringMachineControl tmc = new TuringMachineControl(machine); tmc.DeleteRequested += Tmc_DeleteRequested;; MachinesGrid.Children.Add(tmc); } }