private void showCarDetailsCommand(object sender, RoutedEventArgs e)
 {
     CarSettingsWindow settingsWindow = new CarSettingsWindow(MyListView.SelectedItem as CarEntity);
     settingsWindow.Show();
     Manager.EditCar(MyListView.SelectedItem as CarEntity);
 }
        public void LoadCarFromArchieve(string fileName)
        {
            var car = LoadCarConfigFromArchieve(fileName);

            if (car == null)
            {
                MessageBox.Show("Данный архив не содержит данных автомобиля", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Stop);
                return;
            }

            if (car.Description == null || car.DisplayName == null)
            {
                var settings = new CarSettingsWindow(car);
                settings.ShowDialog();
                car.IsIngame = true;
            }

            var existingCar = Cars.FirstOrDefault(m => m.Name == car.Name);

            if (existingCar != null)
            {
                var result = MessageBox.Show(
                    String.Format("Автомобиль {0} ({1}) уже установлен в игре. Заменить?", existingCar.DisplayName, existingCar.Name),
                    "Внимание", MessageBoxButton.YesNo);
                if (result == MessageBoxResult.No)
                    return;

                //remove all cars matched by name
                while (Cars.Remove(Cars.FirstOrDefault(m => m.Name == car.Name)))
                {
                }
            }
            Cars.Add(car);
            _worklog.AddCar(fileName,car);
        }