If you try to use the special/reserved characters in a string in XAML you will get a slew of errors in your Error List. Example reserved characters include:
- <
- >
- &
- “
For example, if you tried to do this:
<Button Width="100" Height="100" Content="Click &Me"/>
You would get these errors:
Error 5 Entity references or sequences beginning with an ampersand ‘&’ must be terminated with a semicolon ‘;’.
Error 4 ‘"’ is an unexpected token. The expected token is ‘;’. Line 10, position 60.
You can encode invalid characters for use in XAML by using the following encoding syntax:
|
Character |
Encoding |
|
< |
< |
|
> |
> |
|
& |
& |
|
“ |
" |
|
space |
  |
|
‘ |
' |
|
(numeric character mappings) |
&#[integer]; or &#x[hex]; |
|
(nonbreaking space) |
  (assuming UTF-8 encoding) |
So to fix the Button above you would insert “&” wherever you want to use an “&”
<Button Width="100" Height="100" Content="Click &Me"/>






