internal Train() { Handle = new Handle(); Cab = new Cab(); Device = new Device(); Cars = new ObservableCollection <Car>(); Couplers = new ObservableCollection <Coupler>(); }
public object Clone() { return(new Train { Handle = (Handle)Handle.Clone(), Cab = (Cab)Cab.Clone(), Device = (Device)Device.Clone(), Cars = new ObservableCollection <Car>(Cars.Select(c => (Car)c.Clone())), Couplers = new ObservableCollection <Coupler>(Couplers.Select(c => (Coupler)c.Clone())) }); }