You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public WindowsPhoneNavigator(PhoneApplicationFrame rootFrame,
IKnowWhereYourViewIs viewLocator,
ISerializeObjects serializer)
{
_frame = rootFrame;
_viewLocator = viewLocator;
_serializer = serializer;
}
public void NavigateTo<TViewModel>() where TViewModel : class
{
var viewToNavigateTo = _viewLocator.FindViewFor<TViewModel>();
var uri = new Uri(string.Format("/Views/{0}.xaml?vmtype={1}", viewToNavigateTo.Name, typeof(TViewModel).AssemblyQualifiedName), UriKind.RelativeOrAbsolute);
_frame.Navigate(uri);
}
public void NavigateTo<TViewModel, TRequest>(TRequest request) where TViewModel : class
{
var viewToNavigateTo = _viewLocator.FindViewFor<TViewModel>();
var serializedRequest = _serializer.Serialize(request);
var uri = new Uri(string.Format("/Views/{0}.xaml?vmtype={1}&request={2}&requestType={3}", viewToNavigateTo.Name, typeof(TViewModel).AssemblyQualifiedName, serializedRequest, typeof(TRequest).AssemblyQualifiedName), UriKind.RelativeOrAbsolute);