public void SelectSeat(SeatViewModel seatVM) { if (SelectedSeat == null || SelectedSeat != seatVM) { if (!seatVM.IsDisabled && !seatVM.IsOccupied) { SelectedSeat = seatVM; //RefreshMapElements(); } } }
internal List <PlaneElementViewModel> GetDataForSeatsPolSeries(ShapefileConverter shapeFileSeatsPol) { this.SeatVMs = new List <PlaneElementViewModel>(); foreach (ShapefileRecord record in shapeFileSeatsPol) { //create SeatViewModel for each record in the passed shapefileconverter and //add it to list of seatViewmodels. This list will be the data source for the seatPolseries. var seatVM = new SeatViewModel(); seatVM.Id = record.Fields["ID"].ToString(); seatVM.Shape = this.MapProjector.ProjectToGeographic(record.Points); seatVM.Row = record.Fields["ROW"].ToString(); seatVM.Column = record.Fields["COLUMN"].ToString(); //Get the seat position and class from the shape file. seatVM.Class = record.Fields["CLASS"].ToString(); //string seatClassName = record.Fields["CLASS"].ToString(); //Lookup the seat information from the XAML data file and create default if not present //as it is assumed the shape file holds the plane structure information. SeatViewModel seatVMFromPlaneData = PlaneData.GetSeatVM(seatVM.Row, seatVM.Column) ?? new SeatViewModel { Row = seatVM.Row, Column = seatVM.Column, IsOccupied = false, SeatType = SeatType.StandardSeat }; //Values of Properties like the SeatType are not available from the .dbf file of shapefile. //Set such properties from the PlaneData object. seatVM.SeatType = seatVMFromPlaneData.SeatType; seatVM.IsOccupied = seatVMFromPlaneData.IsOccupied; this.SeatVMs.Add(seatVM); //Increment Seat Count for the seatClass as we go through the shape file elements. IncrementSeatCountByClass(seatVM.Class); } _allClass.SeatCount = shapeFileSeatsPol.Count(); SelectedClass = _allClass; return(this.SeatVMs); }