UWP - Multiline TextBox example

MainPage.xaml

<Page
    x:Class="UniversalAppTutorials.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UniversalAppTutorials"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    >
    <StackPanel Padding="50" Background="AliceBlue">
        <TextBox
            x:Name="TextBox1"
            PlaceholderText="Input some text here."
            AcceptsReturn="True"
            TextWrapping="Wrap"
            Margin="5"
            />
        <TextBox
            x:Name="TextBox2"
            PlaceholderText="Input some text here."
            Margin="5"
            />
    </StackPanel>
</Page>
MainPage.xaml.cs

using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml;


namespace UniversalAppTutorials
{
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
            UpdateSecondTextBox();
        }

        private void UpdateSecondTextBox() {
            /*
                TextBox.AcceptsReturn
                    Gets or sets the value that determines whether the text
                    box allows and displays the newline or return characters.

                TextBox.TextWrapping
                    Gets or sets how line breaking occurs if a line of text
                    extends beyond the available width of the text box.
            */

            // Programmatically allow multiline input for second TextBox
            TextBox2.AcceptsReturn = true;
            TextBox2.TextWrapping = TextWrapping.Wrap;
        }
    }
}