Home Contact

X

Coder, not artist.

News

Current archive is at: http://cskardon.wordpress.com/ - I aim to move it all soon! All code on here is free, but as a consequence it's up to you to check it, ha! If you have any questions, feel free to email: cskardon -- @ -- xclave dot co dot uk I'm sure you can decrypt the address there!

Twitter












Archives

Post Categories

Image Galleries

Syndication:

StringFormat annoyances in VS2008

I’ve been using StringFormat in my xaml quite a bit recently, and whilst I’ve liked it, I’ve found that code which is valid tends to cause VS2008 to no longer be able to represent the designer (which some might say is a good thing)…

Basically, the following code:

<TextBlock Text="{Binding MyValue, StringFormat=The value is {0}}"/>

causes VS to basically say ‘no way’ and can no longer render the xaml. Pressing F5 shows the Window just fine… Soo… What can we do about it?

If we modify the ‘StringFormat’ section to read as such:

<TextBlock Text="{Binding MyValue, StringFormat='The value is {0}'}"/>

VS can represent it just fine… The difference? The single quote characters around the value of the StringFormat.

Both versions are valid xaml, just VS can’t represent the former.

Ahh well.


Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: