From b48393942fef461639d1bbb8ab64c15849827270 Mon Sep 17 00:00:00 2001
From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com>
Date: Mon, 8 Jun 2026 03:46:47 +0900
Subject: [PATCH] Add network discovery prompt
---
src/Files.App/Strings/en-US/Resources.resw | 6 ++++
src/Files.App/ViewModels/ShellViewModel.cs | 17 ++++++++-
.../Views/Layouts/GridLayoutPage.xaml | 7 +---
src/Files.App/Views/MainPage.xaml | 35 ++++++++++++++-----
src/Files.App/Views/MainPage.xaml.cs | 7 +++-
5 files changed, 55 insertions(+), 17 deletions(-)
diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw
index f8b5dcdf0fb5..1cb168882c98 100644
--- a/src/Files.App/Strings/en-US/Resources.resw
+++ b/src/Files.App/Strings/en-US/Resources.resw
@@ -4304,6 +4304,12 @@
Open settings
+
+ Network discovery might be turned off
+
+
+ Network devices may not appear when network discovery is turned off. Open Windows Settings to enable it.
+
Visual Studio Code
diff --git a/src/Files.App/ViewModels/ShellViewModel.cs b/src/Files.App/ViewModels/ShellViewModel.cs
index 982ac0a11ec5..04f31033a3d4 100644
--- a/src/Files.App/ViewModels/ShellViewModel.cs
+++ b/src/Files.App/ViewModels/ShellViewModel.cs
@@ -310,6 +310,13 @@ public EmptyTextType EmptyTextType
set => SetProperty(ref emptyTextType, value);
}
+ private bool isNetworkDiscoveryInfoBarOpen;
+ public bool IsNetworkDiscoveryInfoBarOpen
+ {
+ get => isNetworkDiscoveryInfoBarOpen;
+ set => SetProperty(ref isNetworkDiscoveryInfoBarOpen, value);
+ }
+
public async Task UpdateFolderThumbnailImageSource()
{
FolderThumbnailImageSource = await NavigationHelpers.GetIconForPathAsync(WorkingDirectory);
@@ -729,6 +736,7 @@ public void CancelLoadAndClearFiles()
{
Debug.WriteLine("CancelLoadAndClearFiles");
CloseWatcher();
+ IsNetworkDiscoveryInfoBarOpen = false;
if (IsLoadingItems)
{
IsLoadingCancelled = true;
@@ -781,7 +789,14 @@ public string? SearchHeaderTitle
public void UpdateEmptyTextType()
{
- EmptyTextType = FilesAndFolders.Count == 0 ? (IsSearchResults ? EmptyTextType.NoSearchResultsFound : EmptyTextType.FolderEmpty) : EmptyTextType.None;
+ var isFolderEmpty = FilesAndFolders.Count == 0;
+
+ IsNetworkDiscoveryInfoBarOpen =
+ isFolderEmpty &&
+ !IsSearchResults &&
+ string.Equals(WorkingDirectory, Constants.UserEnvironmentPaths.NetworkFolderPath, StringComparison.OrdinalIgnoreCase);
+
+ EmptyTextType = isFolderEmpty ? (IsSearchResults ? EmptyTextType.NoSearchResultsFound : EmptyTextType.FolderEmpty) : EmptyTextType.None;
}
private string? _filesAndFoldersFilter;
diff --git a/src/Files.App/Views/Layouts/GridLayoutPage.xaml b/src/Files.App/Views/Layouts/GridLayoutPage.xaml
index 811a0e03b853..bc0d62c87d24 100644
--- a/src/Files.App/Views/Layouts/GridLayoutPage.xaml
+++ b/src/Files.App/Views/Layouts/GridLayoutPage.xaml
@@ -973,13 +973,9 @@
-
-
-
-
+
diff --git a/src/Files.App/Views/MainPage.xaml b/src/Files.App/Views/MainPage.xaml
index ae1ccb82940a..a022a7a13c03 100644
--- a/src/Files.App/Views/MainPage.xaml
+++ b/src/Files.App/Views/MainPage.xaml
@@ -197,6 +197,7 @@
PreviewKeyDown="RootGrid_PreviewKeyDown"
SizeChanged="RootGrid_SizeChanged">
+
+
+
+
+
+
+
@@ -240,7 +257,7 @@
-
+
-
+
@@ -454,9 +471,9 @@
-
+
-
+
diff --git a/src/Files.App/Views/MainPage.xaml.cs b/src/Files.App/Views/MainPage.xaml.cs
index af82440752c6..6cb20edecf9b 100644
--- a/src/Files.App/Views/MainPage.xaml.cs
+++ b/src/Files.App/Views/MainPage.xaml.cs
@@ -203,6 +203,11 @@ private void UpdateNavToolbarProperties()
InnerNavigationToolbar.ViewModel = SidebarAdaptiveViewModel.PaneHolder?.ActivePaneOrColumn.ToolbarViewModel;
}
+ private async void OpenNetworkAdvancedSettingsButton_Click(object sender, RoutedEventArgs e)
+ {
+ await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:network-advancedsettings"));
+ }
+
protected override void OnNavigatedTo(NavigationEventArgs e)
{
_ = ViewModel.OnNavigatedToAsync(e);
@@ -522,4 +527,4 @@ private async Task AnimateSettingsIconAsync()
AnimatedIcon.SetState(SettingAnimatedIcon, "Normal");
}
}
-}
\ No newline at end of file
+}