I have a scrollbar on my parent UserControl in a Silverlight 4 Business application that I would like to access from a View; I want to simply tell it to scroll to the top. I have tried casting the Parent as the type of the "MainPage", but this does not seem to work. How should I be doing this?
This doesn't work:
((MainPage)Parent).myScrollbar.ScrollToVerticalOffset(0);
I receive the following error:
Unable to cast object of type 'System.Windows.Controls.Frame' to type 'Project.MainPage'.