Opening a UWP within a UWP application
Asked Answered
D

4

5

Maybe a very strange request...

We are looking into building a Windows 10 UWP application that can open websites and other UWP applications within it. I guess the main question is...

In Windows 10 UWP, is there a control that you can open another UWP in (like a WebView for UWP?)

The idea (we haven't started coding that much, because we currently "blueprinting") is to have an application with SplitView (hamburger control) implemented, each button would change the frame to a weblink or link to another UWP app - like Weather for example.

When a user clicks on one option, that would change the main frame to access that content... without leaving the application - think of it as a locked down kiosk (secure).

I am guessing there is not an out-of-a-box solution but thought I would ask :)

Thanks! Matt

Disable answered 3/11, 2015 at 13:54 Comment(4)
You can launch other app with apropriate URI, but I don't think that it would be possible to launch an app wihin another one (at least with official API).Carbaugh
In a Universal Windows App, you can only launch apps via a URI scheme or a file association if one is registered.Switzer
@Kandium you can launch other apps even with parameters but you can NOT display other apps in your current frameBazooka
You can use Windows.Launcher to open other appsLilialiliaceous
F
7

I do not think what you're looking for is exactly possible if I understand you right. In fact, the key-word in UWP app model is isolation or containerization of apps.

That doesn't mean apps do not interact with each other -- the UWP app model does allow apps to interact with URL-based activation/communication; perhaps this is what you need to explore if it meets your requirement. You may like to start from here for some background info.

That said, you can design the UI to mimic as if other apps are contained in splitview or whatever container (an illusion to the user). That is, the UIs in different compartments are simply the view model of the URL communication to other apps in the background.

Felipa answered 5/11, 2015 at 11:51 Comment(1)
Thanks! What I ended up doing, was building an application that is a landing page application (like you said with mimicking), that has a bunch of tiles to open other UWP apps (still thinking about building those tiles dynamically....). This hides the below landing page application which is fine since this is meant for a tablet and the user can just swipe from the left to change the application in focus. Still working on some lockdown security features...Disable
C
0

No you cannot, windows apps are meant for protecting data.

but what you can do is launch another app, any app that is registered to an uri this following code from msdn shows how to bind your own app to an uri and then call it.

var options = new Windows.System.LauncherOptions();
options.PreferredApplicationPackageFamilyName= "Contoso.URIApp_8wknc82po1e";
options.PreferredApplicationDisplayName = "Contoso URI Ap";

// Launch the URI and pass in the recommended app 
// in case the user has no apps installed to handle the URI
var success = await Windows.System.Launcher.LaunchUriAsync(uriContoso, options);
Chrisoula answered 23/12, 2015 at 13:52 Comment(0)
A
0

If you have App's project you can transform it to library easily:

Go to an App you want to embed. Right click on it's Solution -> add new project.

Create Class Library (Universal Windows). Name it YourAppName.Core for example. Delete just created template *.cs file. Select all folders and files from YourAppName project except App.xaml, App.cs, Properties, References, TemporaryKey, Manifest and project.json and drag'n'drop them to your new library YourAppName.Core. Change namespaces from YourAppName to YourAppName.Core in every *.xaml and *.cs file.

Go to YourAppName project. Exclude selected files you moved to library and create a new Page in there, name it MainPage for example. Go to References, right click -> add new reference and pick YourAppName.Core. Make sure that App.cs navigates to typeof MainPage. In MainPage.xaml insert your library like this:

<Grid>
    <YourPageName that was previously in App.cs/>
</Grid>

Run your App. If it works in the same way as it was - everything is ok.

Now go to the MAIN App where you want to embed the app talked above and just make a reference to your library YourAppName.Core. Simply use it in your XAML anywhere you wish or create instances from code behind.

Argeliaargent answered 13/9, 2016 at 8:18 Comment(0)
M
0

You can pack your two applications inside Windows Application Packaging Project and then try triggering the one from another, check here for reference : https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-packaging-dot-net I have tried with .Net application along with UWP app.

Maxim answered 31/3, 2022 at 13:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.