private void GoToTextMode()

in FamilyNotes/Controls/Note.xaml.cs [294:323]


        private void GoToTextMode(NoteInputMode mode, bool setFocus)
        {
            if (mode != NoteInputMode.Text && mode != NoteInputMode.Dictation)
            {
                return;
            }
            InputMode = mode;

            VisualStateManager.GoToState(this, "TextInput", true);

            if (setFocus)
            {
                _ = containerForText.Focus(FocusState.Keyboard);
            }

            // Move text controls to primary commands and
            // ink controls to secondary commands in the command bar.
            if (NoteCommandBar.PrimaryCommands.Contains(NoteTypeInk))
            {
                NoteCommandBar.PrimaryCommands.Remove(NoteTypeInk);
                NoteCommandBar.SecondaryCommands.Add(NoteTypeInk);
            }
            if (NoteCommandBar.SecondaryCommands.Contains(NoteTypeText))
            {
                NoteCommandBar.SecondaryCommands.Remove(NoteTypeText);
                NoteCommandBar.PrimaryCommands.Add(NoteTypeText);
            }

            containerForInk.Strokes.Clear();
        }