How can I use something like the “#if” directive inside XAML. I’ve declared a credentials key for my Bing Maps control and I want to turn off the key when I’m not live. The key is in a resource dictionary. How can I disable this in debug?
Share
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.
I haven’t tested this, but I wonder if this or something like it would work.
You could declare this public property in whatever the map’s DataContext is (view model or otherwise).
(MSDN says we should use ApplicationIdCredentialsProvider.)
Then you can simply bind to this property, since CredentialsProvider is a dependency property: