public static RoomRenovationWindow GetInstance(Room roomForRenovation) { if (instance == null) { instance = new RoomRenovationWindow(roomForRenovation); } return(instance); }
private void renovationMenuItem_Click(object sender, RoutedEventArgs e) { Room selectedRoom = (Room)roomsUserControl.allRoomsTable.SelectedItem; if (roomsUserControl.allRoomsTable.SelectedItem != null) { if (selectedRoom.RoomRenovationState.ActivityStatus) { RenovationMessageWindow.GetInstance().ShowDialog(); } else { RoomRenovationWindow.GetInstance(selectedRoom).ShowDialog(); } } else { MessageBox.Show("Izaberite prostoriju iz tabele!", "Upozorenje", MessageBoxButton.OK, MessageBoxImage.Warning); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { instance = null; }