Escape the Curly Braces in XAML

Your 2020 Plan. Learn 20 minutes a day for 20 days. Online courses from €9.99.

If you want to set the value of a property to a string that begins with the open curly brace in XAML , you may want to escape  it in order to avoid it being treated as markup extension.

How to escape the Curly Braces in XAML  ?

You can do this by preceding the string with the empty pair of curly braces. Below is a sample code snippet on how to do it.

<Button Content="{}{This is a developerpublish blog}">


Alternatively , you can use the property element syntax without escaping the curly braces as shown below.

          {This is a developerpublishblog}

Leave a Reply

Your email address will not be published. Required fields are marked *