Search code examples
c#wpfxamltriggersdatatrigger

How do I match "newline" in a DataTrigger?


In my XAML, I am trying to implement the folowing:

<DataTrigger Binding="{Binding Path=Word}" Value="\n">

but this does not work, even though Word is \n. I suspect that \n is not the right way to express newline in XAML, but what would be?


Solution

  • Does this solve the problem?

    <DataTrigger Binding="{Binding Path=Word}" Value="&#10;">