I'm trying to bind events to my LibraryBarItem, however when I finished like this, the MouseDown event will never be fired, can anybody tell me what happend?
LibraryBar folderContainer = new LibraryBar();
foreach (Image folder in states.Preparation.folders)
{
LibraryBarItem folderItem = new LibraryBarItem();
folderItem.MouseDown += clickFolder;
folderItem.Content = folder;
folderItem.Name = folder.Name;
folderContainer.Items.Add(folderItem);
}
static public void clickFolder(object sender, MouseButtonEventArgs e)
{
MessageBox.Show("Come!");
}