Hello.
I have some problems with recieving text from ListBoxItem. My code is below:
ListBox list = (ListBox)this.FindName(e.Parameter.ToString());
ListBoxItem item = (ListBoxItem)list.Items.GetItemAt(0); //****here is exception****
T.Text = item.Content.ToString();
list.Items.RemoveAt(0);
The exception throws:
Unable to cast object of type 'System.String' to type 'System.Windows.Controls.ListBoxItem'.
My ListBox contains numbers, but it does not matter. I just wanna get a handle to first element on list.