WPF Button content with '&' not accepting

前端 未结 4 1887
伪装坚强ぢ
伪装坚强ぢ 2020-12-10 10:38

I am creating and with content \'Save & Add\'. I write it in XAML, but the symbol \'&\' is not accepting. What is the reason for that. How can I do that?

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 11:06

    From Wikipedia:

    Unlike traditional HTML with its large range of character entity references, in XML there are only five predefined character entity references. These are used to escape characters that are markup sensitive in certain contexts:

    • & → & (ampersand, U+0026)
    • < → < (less-than sign, U+003C)
    • > → > (greater-than sign, U+003E)
    • " → " (quotation mark, U+0022)
    • ' → ' (apostrophe, U+0027)

提交回复
热议问题