The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
Textbox in mainView cannot get keypad input after switch back from second view in multiple views app. RRS feed

  • Question

  • In mainview page (main page), I have one textbox and one button. The second view page(second page) has a button and a textbox as well.

    After app launched, I can key on characters into the main page.

    The button on main page will trigger to switch to second view by following code,

    private async void Goto2ndView(object sender, TappedRoutedEventArgs e)
            {
                int iMainViewId = ApplicationView.GetForCurrentView().Id;

                int iSecondViewId = 0;

                CoreApplicationView   secondView = CoreApplication.CreateNewView();
                await secondView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
                {
                        try
                        {
                            Window.Current.Content = new SecondPage();
                            iSecondViewId = ApplicationView.GetForCurrentView().Id;
                            Window.Current.Activate();
                        }
                        catch (Exception)
                        {

                        }
                    });
                }
                await ApplicationViewSwitcher.SwitchAsync(iSecondViewId, iMainViewId, ApplicationViewSwitchingOptions.SkipAnimation);

            }

    After switched to second view, I can key in characters into the second page's textbox.

    In the second page's button tapped event, switch back to main view,

    private async void GotoMainView(object sender, TappedRoutedEventArgs e)
    {
          try
          {
               await ApplicationViewSwitcher.SwitchAsync(iMainViewId);//, ApplicationView.GetForCurrentView().Id, ApplicationViewSwitchingOptions.ConsolidateViews);
          }
          catch (Exception)
          {
          }
    }
     

    Now, in the main page's textbox, I cannot key in any characters. When I touch on the textbox, soft keypad can be popped out. But touch on keys will not input into the textbox. Have tried to consolidate the views and close the second page after switch back to main view, I still cannot key in any characters into the main page's textbox.  

    Tuesday, November 26, 2019 4:35 AM

All replies

  • Hi,

    I tested the code and reproduced the same issue, the textbox can't be input any character. But I'm not sure what caused this unexpected behavior. I'll ask the team about this issue. There might be some time delay.

    Best Regards,

    Fay


    "Developing Universal Windows apps" forum will be migrating to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Developing Universal Windows apps" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.

    Tuesday, November 26, 2019 7:04 AM