public VehicleEntry(ParkingSlotViewModel slotVM) { InitializeComponent(); //this.slotid = slotid; lblSlotID.Content = slotVM.Slot.SlotID; this.DataContext = slotVM; }
public SlotsPage() { InitializeComponent(); parkingslots = new ObservableCollection <ParkingSlot>(); _parkingViewmodel = new ParkingSlotViewModel(); slotsview(); }
private void Button_Click(object sender, RoutedEventArgs e) { string slotid = ((Button)sender).Content.ToString(); ParkFloorViewModel floorVM = (ParkFloorViewModel)this.DataContext; if (floorVM.SlotOccupied(slotid)) { ParkingInfo.SlotID = slotid; Window detailsWindow = new ParkingInfo(); detailsWindow.Owner = Application.Current.MainWindow; detailsWindow.Show(); detailsWindow.Closed += (sender1, e1) => ParkingEntryWindowClosed(sender1, e1, slotid); } else { ParkingSlotViewModel slotVM = floorVM.GetParkingSlotVM(slotid); Window entryWindow = new VehicleEntry(slotVM); entryWindow.Owner = Application.Current.MainWindow; entryWindow.Show(); entryWindow.Closed += (sender1, e1) => AddEntryWindowClosed(sender1, e1, slotid); } }