Given a PhoneApplicationPage sub type, is there a way (other than relying on convention) to figure out its internal uri?
In other words, I want to call GetUri<MyPage>() and get back something like /Views/MyPage.xaml.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no way to do this. There is no meta data that points relates a XAML file name to a type. The filename is essentially the key by which the runtime identifies the BAML to load and it’s from that BAML that it knows the type. Going the other direction would be very difficult.
Short of reading the BAML resource streams and figuring out the mapping yourself (which can’t easily be done in Silverlight and would kill performance even if it could) I can’t see a way of doing this.