Skip to content

Commit 58094e2

Browse files
committed
Easily Open More Files Instance Windows from Ribbon
1 parent b73afdb commit 58094e2

File tree

5 files changed

+40
-10
lines changed

5 files changed

+40
-10
lines changed

Files UWP/App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,23 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
125125
}
126126
}
127127

128+
protected override void OnActivated(IActivatedEventArgs args)
129+
{
130+
// Window management
131+
Frame rootFrame = Window.Current.Content as Frame;
132+
if (rootFrame == null)
133+
{
134+
rootFrame = new Frame();
135+
Window.Current.Content = rootFrame;
136+
}
137+
138+
// Open the page that we created to handle activation for results.
139+
rootFrame.Navigate(typeof(InstanceTabsView), null, new SuppressNavigationTransitionInfo());
140+
141+
// Ensure the current window is active.
142+
Window.Current.Activate();
143+
}
144+
128145
private void TryEnablePrelaunch()
129146
{
130147
Windows.ApplicationModel.Core.CoreApplication.EnablePrelaunch(true);

Files UWP/ProHome.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@
539539
<CommandBar Background="Transparent" OverflowButtonVisibility="Collapsed" DefaultLabelPosition="Right">
540540
<CommandBar.Content>
541541
<CommandBar Background="Transparent" OverflowButtonVisibility="Collapsed" DefaultLabelPosition="Right">
542-
<AppBarButton Label="Open new window" Icon="NewWindow"/>
542+
<AppBarButton Name="NewWindowButton" Click="NewWindowButton_Click" Label="Open new window" Icon="NewWindow"/>
543543
<AppBarButton Name="SettingsButton" Click="SettingsButton_Click" Label="Settings" Icon="Setting"/>
544544
</CommandBar>
545545
</CommandBar.Content>

Files UWP/ProHome.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,16 @@ private void Button_Click(object sender, RoutedEventArgs e)
963963
{
964964
//this.accessibleContentFrame
965965
}
966+
967+
private async void NewWindowButton_Click(object sender, RoutedEventArgs e)
968+
{
969+
var filesUWPUri = new Uri("files-uwp:");
970+
var options = new LauncherOptions()
971+
{
972+
DisplayApplicationPicker = false
973+
};
974+
await Launcher.LaunchUriAsync(filesUWPUri);
975+
}
966976
}
967977
public class NavigationActions
968978
{

FilesUwp.Package/FilesUwp.Package.wapproj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,32 +54,32 @@
5454
<AppInstallerUpdateFrequency>1</AppInstallerUpdateFrequency>
5555
<AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>
5656
<AppxPackageDir>C:\builds\store</AppxPackageDir>
57-
<AppxSymbolPackageEnabled>True</AppxSymbolPackageEnabled>
57+
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
5858
<AppxBundlePlatforms>x86|x64|arm|arm64</AppxBundlePlatforms>
5959
</PropertyGroup>
6060
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
61-
<AppxBundle>Always</AppxBundle>
61+
<AppxBundle>Never</AppxBundle>
6262
</PropertyGroup>
6363
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
64-
<AppxBundle>Always</AppxBundle>
64+
<AppxBundle>Never</AppxBundle>
6565
</PropertyGroup>
6666
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
67-
<AppxBundle>Always</AppxBundle>
67+
<AppxBundle>Never</AppxBundle>
6868
</PropertyGroup>
6969
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
70-
<AppxBundle>Always</AppxBundle>
70+
<AppxBundle>Never</AppxBundle>
7171
</PropertyGroup>
7272
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
73-
<AppxBundle>Always</AppxBundle>
73+
<AppxBundle>Never</AppxBundle>
7474
</PropertyGroup>
7575
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
76-
<AppxBundle>Always</AppxBundle>
76+
<AppxBundle>Never</AppxBundle>
7777
</PropertyGroup>
7878
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
79-
<AppxBundle>Always</AppxBundle>
79+
<AppxBundle>Never</AppxBundle>
8080
</PropertyGroup>
8181
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
82-
<AppxBundle>Always</AppxBundle>
82+
<AppxBundle>Never</AppxBundle>
8383
</PropertyGroup>
8484
<ItemGroup>
8585
<AppxManifest Include="Package.appxmanifest">

FilesUwp.Package/Package.appxmanifest

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
</uap:VisualElements>
2323
<Extensions>
2424
<desktop:Extension Category="windows.fullTrustProcess" Executable="ExecutableLauncher/ExecutableLauncher.exe" />
25+
<uap:Extension Category="windows.protocol">
26+
<uap:Protocol ReturnResults="none" Name="files-uwp"/>
27+
</uap:Extension>
2528
</Extensions>
2629
</Application>
2730
</Applications>

0 commit comments

Comments
 (0)