Search code examples
c#c++uwpwindows-iot-core-10app-launcher

Windows IoT Core launcher with Navbar


I am working on a project with Windows 10 IoT Core and I have recently managed to launch an UWP app from another one by using Windows.ApplicationModel.Core.AppListEntry.LaunchAsync().
My test launcher is the one used in Microsoft's IoT Examples, with some minor UI changes. The code I use for launching an app is:

void MainPage::StackPanel_Tapped(Object^ sender, TappedRoutedEventArgs^ e) {
    auto appItem = dynamic_cast<AppListItem^>(appList->SelectedItem);
    if (appItem) {
        appItem->AppEntry->LaunchAsync();
    } 
}

(the same code can be found here)

The app list is populated using the PackageManager API, as shown in the sample project "IoTStartApp" linked above. When I tap an item, the correspondent application is started covering the entire screen.
Since I don't have any external device apart from a touchscreen display, I would like to integrate the navigation buttons (Home and Back) in my launcher. So the actual question is, do the actual UWP APIs allow to launch another UWP app inside an area of my launcher, in order to leave some space for my navigation bar? (Like a frame, but instead of showing a page from the current app it should contain a page of another application).
My idea is to start an app with an argument telling where to start, like LaunchInContainerAsync(Frame frame), where frame is my container (imagine a page with only this container and my two navigation buttons at the bottom, in another grid). XAML would be something like this:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="*"/>
        <RowDefinition Height="30"/>
    </Grid.RowDefinitions>
    <Frame x:Name="ApplicationFrame" Grid.Row="0" Margin="0"/>
    <Grid x:Name="NavBar" Grid.Row="1" Margin="0">
        <!-- Here are my other UI elements that should stay visible during the execution of the "launched" application, such as navigation buttons. -->
    </Grid>
</Grid>

I'm asking this because I remember (but I'm surely wrong) that there were some examples from Microsoft showing this kind of application launching solution, but now they migrated (and eventually removed) many examples and wiki pages from their documentation and GitHub repos. If this isn't possible, what are some other navigation solutions? Has somebody successfully created a launcher for Windows 10 IoT Core that works only with a touchscreen display?


Solution

  • AFAIK, this can not be done on Windows IoT Core because either launcher app or launched app is running as a foreground app itself and there is only one foreground hold the whole UI in hand. So "leave some space for my navigation bar" seems impossible.

    But as a workaround, you can add the launcher app's (like home app in the following sample) URI or its display name and description get from AppListEntry API to others apps you are going to launch, so the newly launched app can get chance to go back to the launcher app. Like this sample do: "IoTHomeApp".

    ShellHomeApp: enter image description here

    OemApp2:

    enter image description here