I have never had this issue with calling IndexOf. I have a simple control in a stackpanel and I add it to a list to be sorted later:
ItenGSDefCtrl gsDefCtrl = new ItenGSDefCtrl()
When I click a button on that control I want it to get the current index in the list for that control.
int cIndex = this.gl_itenOdrLst.IndexOf(sender);
Seems simple right? Well it keeps returning -1 even though I can see the control(s) in the list in the debugger...I've never had this issue before. Did something change in win8 with the way you can retrieve index locations?