I am trying to launch MAUI app-A from MAUI app-B in Windows. After launching app-A, I want that app-A will send in response some API-Object to control app-A from app-B.
I need to control more than one instance of App-A from App-B, so that each instance of app-A need to return its own API-Object.
I tried to use
Microsoft.Maui.ApplicationModelLuncher
https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/appmodel/launcher?tabs=windows but it doesn't return value as response (it returns true/false for success/failure)I tried to use
Windows.System.Launcher.LaunchUriForResultsAsync
var testAppUri = new Uri($"App_A:"); // The protocol handled by the launched app
var options = new LauncherOptions();
options.TargetApplicationPackageFamilyName = Windows.ApplicationModel.Package.Current.Id.FamilyName;
var inputData = new ValueSet();
inputData["sn"] = sn;
LaunchUriResult result =
await Windows.System.Launcher.LaunchUriForResultsAsync(testAppUri, options, inputData);
but I am getting exception
System.InvalidOperationException: 'Element not found.