private void ConfirmButtonOnClicked(object sender, EventArgs eventArgs) { if (string.IsNullOrEmpty(_idEntry.Text)) { _tangoService.Insert ( _tangoEntry.Text.Trim(), _furiganaEntry.Text.Trim(), _romajiEntry.Text.Trim(), _honyakuEntry.Text.Trim() ); } else { _tango.Namae = _tangoEntry.Text.Trim(); _tango.Furigana = _furiganaEntry.Text.Trim(); _tango.Romaji = _romajiEntry.Text.Trim(); _tango.Honyaku = _honyakuEntry.Text.Trim(); _tangoService.Update(_tango); } if (_parentWindow.GetType() == typeof(TangoList)) { var list = _parentWindow as TangoList; list.RefreshList(); } Destroy(); }