RichTextBox for UWP | ComponentOne
RichTextBox for UWP Quick Start / Step 1 of 3: Creating a Universal Windows Application
In This Topic
    Step 1 of 3: Creating a Universal Windows Application
    In This Topic

    In this step you'll create a new Universal Windows application, set the application up, and add the C1RichTextBox control to the application. After completing this step, you should have a mostly functional Rich Text editor.

    Complete the following steps:

    1. In Visual Studio select File | New | Project.
    2. In the New Project dialog box, select Templates | Visual C# | Windows | Universal. From the templates list, select Blank App (Universal Windows). Enter a Name and click OK to create your project.
    3. Right-click the project name in the Solution Explorer and select Add Reference.
    4. In the Reference Manager dialog box, expand Universal Windows and select Extensions; you should see the UWP assemblies in the center pane. Select C1.UWP.RichTextBox.
    5. Open MainPage.xaml if it isn't already open, and add the following markup within the <Page> tag:
    XAML Markup
    Copy Code

    This adds references to the required assembly to the project.

    1. In the XAML window of the project, place the cursor between the <Grid x:Name="ContentPanel"></Grid> tags and click once.
    1. Add the following markup within the <Grid> tags to add the C1RichTextBox control. Note that this markup gives the control a name:  
    XAML Markup
    Copy Code
    <RichTextBox:C1RichTextBox Name="C1RTB" />
    1. Place your cursor beneath the markup for the C1RichTextBox control you just added. Locate the C1RichTextBoxMenu control in the Visual Studio Toolbox and double-click to add it to your application.
    2. Edit the C1RichTextBoxMenu markup so that it resembles the following sample. This will give the C1RichTextBoxMenu a name and bind it to the C1RichTextBox control:
    XAML Markup
    Copy Code
    <RichTextBox:C1RichTextBoxMenu x:Name="rtbMenu" RichTextBox="{Binding ElementName=RTB1}" />

      What You've Accomplished

    If you run the application, you'll see an almost fully functional C1RichTextBox application. You can enter and edit text in the C1RichTextBox control. In the next step you'll customize the application further.