public void OnItemClicked(object sender, ImageListPanelEventArgs e) { m_selectedIndex = (e).SelectedItem; //remove listner m_imagePanel.ItemClick -= OnItemClicked; // close the drop-dwon, we are done wfes.CloseDropDown(); m_imagePanel.Dispose(); m_imagePanel = null; }