Recognize Handwriting Letters on InkCanvas

Handwriting letters on InkCanvas controls can be recognized as follows.

XAML

<InkCanvas x:Name="inkCanvas" />

Recognition

namespace MyApp
{
    using Windows.UI.Core;

    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            InitializeComponent();
            inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Touch | CoreInputDeviceTypes.Pen;
        }        

        private void button_Click(object sender, RoutedEventArgs e)
        {
            ShowRecognizedText();
        }

        private async void ShowRecognizedText()
        {
            var inkRecContainer = new InkRecognizerContainer();
            if (inkCanvas.InkPresenter.StrokeContainer.GetStrokes().Count > 0)
            {
                var result = await inkRecContainer.RecognizeAsync(inkCanvas.InkPresenter.StrokeContainer, InkRecognitionTarget.All);
                if (result != null)
                {
                    var dlg = new Windows.UI.Popups.MessageDialog(result.FirstOrDefault().GetTextCandidates().FirstOrDefault());
                    await dlg.ShowAsync();
                }
            }
        }
    }
}

Result