Let’s say I’ve this path /Views/LoginView.xaml, How can I create an instance of a View by a specified Uri in Silverlight?
Edit: I’m working on a project which is completely developed by another developers. What I want to do is a simple logging system which able to log each View visited by users. There are one frame in MainPage and a class which is responsible to handle requests to Pages. Class has a reference to MainPage and its Frame and has a method to navigate to specific Page by given Path. I know I’ve path here to log that request, but its just a path, I want to have an instance of that page to get its title and log that title instead of its path.
From what I can understand, you need to create an instance of a class given the class name. This can be achieved using Reflection and more specifically Activator.CreateInstance(string className)
You can extract the class name from the path by using Path.GetFileNameWithoutExtension()