Your example works fine as well as some other panes I tried to hide, but here's the situation:
- I have PaneGroup (oPaneGroup1) which contains a Pane of type iCPane which is a class inheriting RadPane with a few more properties I need.
- I have another PaneGroup (oPaneGroup3) which contains a Pane of type RadPane, which is the one I'm trying to hide.
Calling oPaneGroup3.HideAllPanes() causes:
"Exception has been thrown by the target of an invocation."
After examining the InnerException I discovered the following:
has been thrown by the target of an invocation. --->
System.InvalidCastException: Unable to cast object of type
'Telerik.Windows.Controls.RadPane' to type 'iCapture.iCPane'."
& vbCrLf & " at iCapture.DockingExtensions.dock_PreviewClose
(Object sender, StateChangeEventArgs e)" & vbCrLf & "
--- End of inner exception stack trace ---
I don't understand how the iCPane class is involved in this, since oPaneGroup3 only contains a normal RadPane, and I'm only calling HideAllPanes() on oPaneGroup3... Your thoughts on this?