void CarParentEditor_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
if (!IsResultOk) return;
var current = CarsListView.CurrentItem as CarObject;
if (current != null) {
if (Car.Children.Any()) {
if (ShowMessage(ControlsStrings.CarParent_ChildrenWillBeMoved, ToolsStrings.Common_Warning, MessageBoxButton.OKCancel) !=
MessageBoxResult.OK) return;
}
if (!File.Exists(Car.UpgradeIcon)) {
var dialog = new UpgradeIconEditor(Car);
dialog.ShowDialog();
if (!dialog.IsResultOk) return;
}
foreach (var child in Car.Children) {
child.ParentId = current.Id;
}
Car.ParentId = current.Id;
} else {
Car.ParentId = null;
}
}