Get at the DataContext of frame.Source and be able to set it

Apr 27, 2013 at 10:33 AM
I have the following code, in which I need to set something in the DataContext of a control that has been loaded and set as frame.Source.

Am I doing this wrong, or is there a better way to do this ?
var frame = NavigationHelper.FindFrame(null, this.View);
if (frame != null)
frame.Source = new Uri("/Pages/Project/Content/ProjectItemView.xaml", UriKind.Relative);
// Need to set the context here somehow
Again thanks in advance

Mark H
Apr 27, 2013 at 5:33 PM
Why not set the datacontext of the frame directly? The DataContext property is inherited by child controls