Skip to content

Commit 2019a83

Browse files
committed
Labels for TabViewItems now update on folder change
1 parent 1e3f5a9 commit 2019a83

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

Files UWP/Filesystem/ItemViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ public async void DisplayConsentDialog()
204204

205205
public async void AddItemsToCollectionAsync(string path, Page currentPage)
206206
{
207+
InstanceTabsView.SetSelectedTabHeader(new DirectoryInfo(path).Name);
207208
CancelLoadAndClearFiles();
208209

209210
_cancellationTokenSource = new CancellationTokenSource();

Files UWP/InstanceTabsView.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124
</Button.KeyboardAccelerators>
125125
</Button>
126126
</Custom:TabView.TabActionHeader>
127-
128127
</Custom:TabView>
129128

130129
</Grid>

Files UWP/InstanceTabsView.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ public void AddNewTab(Type t, string path)
9797

9898
}
9999

100+
public static void SetSelectedTabHeader(string text)
101+
{
102+
(tabView.Items[tabView.SelectedIndex] as TabViewItem).Header = text;
103+
}
104+
100105
private void Tvi_Loaded(object sender, RoutedEventArgs e)
101106
{
102107
//tabContentPresenter.Content = ((TabStrip.SelectedItem as TabViewItem));

Files UWP/Settings.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
using Windows.UI.ViewManagement;
55
using Windows.UI.Xaml;
66
using Windows.UI.Xaml.Controls;
7-
8-
7+
using Windows.UI.Xaml.Navigation;
98

109
namespace Files
1110
{

Files UWP/YourHome.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public T GetCurrentSelectedTabInstance<T>()
6161
protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
6262
{
6363
base.OnNavigatedTo(eventArgs);
64+
InstanceTabsView.SetSelectedTabHeader("Favorites");
6465
GetCurrentSelectedTabInstance<ProHome>().BackButton.IsEnabled = GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.CanGoBack;
6566
GetCurrentSelectedTabInstance<ProHome>().ForwardButton.IsEnabled = GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.CanGoForward;
6667
GetCurrentSelectedTabInstance<ProHome>().RefreshButton.IsEnabled = false;

0 commit comments

Comments
 (0)