Witam. Korzystam z c#, .net 4.0 i WPF. Mam funkcję która generuje kilka elementów DockPanel i umieszcza je wewnątrz jednego WrapPanel'a. Jak zrobić, by wewnątrz metody dockmouseenter móc rozpoznać który DockPanel został kliknięty? Chodzi mi o jakieś ponumerowanie tych DockPaneli.
private void parseGames()
{
this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, (Action)(() =>
{
int i=0;
while(i< serwerostatni.GetElementsByTagName("games").Item(0).ChildNodes.Count)
{
DockPanel dock = new DockPanel();
dock.Height = 165;
dock.Width = 136;
System.Windows.Controls.Label lab = new System.Windows.Controls.Label();
lab.Content = serwerostatni.GetElementsByTagName("games").Item(0).ChildNodes.Item(i).Attributes.GetNamedItem("name").InnerText;
dock.MouseDown += dockmouseenter;
dock.Children.Add(lab);
listagier.Children.Add(dock);
i++;
}
}));
}
void dockmouseenter(object o, System.Windows.Input.MouseEventArgs a)
{
char[] splitn = new char[1];
splitn[0] = '/';
enginestart(0);
System.Threading.ThreadPool.QueueUserWorkItem(start);
}