Text box is defined in following code:
<TextBox Grid.Row="2" IsReadOnly="{Binding IsDescriptionReadOnly}" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}"/>e
When enter is pressed, a new line is not inserted. How to fix this problem?
Adding Line Breaks Sometimes you will want to insert a line break within a TextBlock. You can do this with a LineBreak inline, added as an XAML element within the text. A new line will be started at the position of this element.
Here's how to create a TextBox in XAML and in code. TextBox textBox = new TextBox(); textBox. Width = 500; textBox. Header = "Notes"; textBox.
I had similar problem, I solved it with this question using AcceptsReturn="True"
. So I think, this should work.
What you have should work fine, assuming
I'd suggest you try this outside of your project to get a better indication of the actual issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With