/// <summary> /// React on cancelling new item. /// </summary> /// <param name="e">Cancelling item event args.</param> public void OnNewItemCancelling(DataGridItemHandledEventArgs e) { // Supporting API issues. Needed in case of external new item creating canceling. if (!_isInEditedMode) { return; } _canceledByGrid = true; ObjectLayer.DeleteObject(_currentItem, _parentLayer.MapLayer); _EditEnded(false); e.Handled = true; _canceledByGrid = false; _SetToolsEnabled(false); _currentItem = null; }