private void deleteButton_Click(object sender, RoutedEventArgs e) { YesNoWindow yy = new YesNoWindow("Do you want to delete this task ?"); yy.ShowDialog(); if (yy.ans == true) { bolayer.task_delete(tasknow); ftp.deletefile(tasknow.folder); bolayer.load_task_form_server(); } }