0

I'm trying to launch a uri from my windows 8.1 app but can't get it to launch in UseHalf mode I researched and found that it should be done like this

       LauncherOptions lo = new LauncherOptions();
       lo.DesiredRemainingView = ViewSizePreference.UseHalf;
       lo.DisplayApplicationPicker = true;
       await Windows.System.Launcher.LaunchUriAsync(new Uri("http://www.youtube.com"),lo);

but it keeps launching the web browser in full screen I read that the launch depends on many variables and it is not insured that these settings will be applied

my question is there a way to insure that my app and the browser will open side by side in half screen mode?

4

2 に答える 2

0

msdn 開発者フォーラムを調べたところ、これが唯一の方法であり、アプリがこの種の動作を強制する方法がないことがわかりました。このコードの結果は、ブラウザーの設定や他の多くの変数に依存します。

于 2013-10-21T21:27:12.043 に答える
0

動作する必要があります:

Uri uri = new Uri("http://www.youtube.com");
LauncherOptions options = new LauncherOptions
{
    DesiredRemainingView = ViewSizePreference.UseHalf
};

await Launcher.LaunchUriAsync(uri, options);

そうでない場合は、次の長いコードを試してください。

ApplicationView currentAppView = ApplicationView.GetForCurrentView();  

CoreApplicationView newCoreAppView = CoreApplication.CreateNewView();  

newCoreAppView.Dispatcher.RunAsync(  
  CoreDispatcherPriority.Normal,  
  async () =>  
  {  
    // This executes on the new dispatcher so I assume that Window.Current and so on  
    // reflects the new Window associated with that dispatcher rather than the original  
    // dispatcher.  
    Window newWindow = Window.Current;  
    ApplicationView newAppView = ApplicationView.GetForCurrentView();  


    await ApplicationViewSwitcher.TryShowAsStandaloneAsync(  
      newAppView.Id,  
      ViewSizePreference.UseHalf,  
      currentAppView.Id,  
      ViewSizePreference.UseHalf);  
  });

ここから。

于 2013-10-21T18:11:25.457 に答える