Created
December 23, 2016 12:09
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 static void Navigate<T>(Window w, object context){ | |
((Frame) w.Context).Navigate(typeof(T), | |
new NavigationParameters{ | |
ViewModel = GetViewModel<T>(), | |
Context = context ?? GetContext<T>() | |
}); | |
} | |
private static object GetViewModel<T>(){ | |
if (typeof (T) == typeof(Vehicle)){ | |
return Factory.CreateVehicleViewModel(); | |
} | |
... | |
throw new NotImplementedException("Can't navigate to such page"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment