Reputation: 105
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
Upvotes: 5
Views: 3336
Reputation: 11
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.
Upvotes: 0
Reputation: 1488
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.
Upvotes: 0
Reputation: 599
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);
Upvotes: 0
Reputation: 921
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.
Upvotes: 7