/// <summary> /// Listen to text input to the main window (E.g. key presses) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MainWindow_TextInput(object sender, TextCompositionEventArgs e) { if (!string.IsNullOrWhiteSpace(e.Text)) { // if not handled by current demo. if (!m_CurrentDemo.HandleKeyPress(e.Text[0])) { // Finish Current Demo m_CurrentDemo.Finish(); // id passed - Default Demo used if id out of range SetCurrentDemo(e.Text[0]); } } }