private void NewRoom(object sender, AddingNewEventArgs e) { var room = new Room { FloorNumber = (Floor)Floors.GetValue(Randomizer.Next(Floors.Length)), HostelNumber = (Hostel)Hostels.GetValue(Randomizer.Next(Hostels.Length)), Capacity = (Capacity)Capacities.GetValue(Randomizer.Next(Capacities.Length)), RoomNumber = Randomizer.Next(100, 500) }; e.NewObject = room; }