I'm using MVVM architecture in a WP7 phone app. My current view is a user control, which exists inside of a parent page (standard page -- not stand-alone user control). I have passed the main page as a parent to a "parent" property of the user control, and I can access pretty much any control in the parent. For example: this works to access a lockable pivot in the parent:
Dim p As LockablePivot
p = MyParent.FindControl("myLockablePivot")
If p IsNot Nothing Then
..do something with the pivot
End If
My problem is in accessing the ApplicationBar in the parent. This does not work. I have triple checked the x:Name assigned to the application bar. (null reference exception):
Dim ap As ApplicationBar
ap = MyParent.FindName("appBar")
ap.IsVisible = False
Any help would be appreciated.