public static TripInfoBlock GetInstance(Employee employee, TripDecorator trip) { if (State == null) { State = new TripInfoBlock(employee, trip); } return(State); }
private void TripsInfoButton_Click(object sender, RoutedEventArgs e) { try { TripContentArea.Content = TripInfoBlock.GetInstance(employee, trips.Where(t => t.trip.Id == Convert.ToInt32(IdOfTripForAction.Text)).FirstOrDefault()); } catch (Exception ee) { MessageBox.Show(ee.Message); } }