Skip to content

Commit 278f94f

Browse files
committed
Ensure Favorites is added to the Pathbar when necessary
1 parent f06a1f9 commit 278f94f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Files UWP/YourHome.xaml.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using System.Runtime.InteropServices;
1616
using System.IO;
1717
using Windows.UI.Popups;
18+
using Windows.UI.Text;
1819

1920
namespace Files
2021
{
@@ -53,6 +54,8 @@ public YourHome()
5354
VideosPath = localSettings.Values["VideosLocation"].ToString();
5455
}
5556
}
57+
58+
5659
}
5760

5861
public T GetCurrentSelectedTabInstance<T>()
@@ -86,6 +89,25 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
8689
GetCurrentSelectedTabInstance<ProHome>().accessiblePasteButton.IsEnabled = false;
8790
GetCurrentSelectedTabInstance<ProHome>().AlwaysPresentCommands.isEnabled = false;
8891
GetCurrentSelectedTabInstance<ProHome>().LayoutItems.isEnabled = false;
92+
93+
// Clear the path UI and replace with Favorites
94+
GetCurrentSelectedTabInstance<ProHome>().accessiblePathTabView.Items.Clear();
95+
Style tabStyleFixed = GetCurrentSelectedTabInstance<ProHome>().accessiblePathTabView.Resources["PathSectionTabStyle"] as Style;
96+
FontWeight weight = new FontWeight()
97+
{
98+
Weight = FontWeights.SemiBold.Weight
99+
};
100+
string componentLabel = "Favorites";
101+
string tag = "Favorites";
102+
GetCurrentSelectedTabInstance<ProHome>().accessiblePathTabView.Items.Add(new Microsoft.UI.Xaml.Controls.TabViewItem()
103+
{
104+
Header = componentLabel + " >",
105+
Tag = tag,
106+
CornerRadius = new CornerRadius(0),
107+
Style = tabStyleFixed,
108+
FontWeight = weight
109+
});
110+
89111
}
90112

91113
private void CardPressed(object sender, ItemClickEventArgs e)

0 commit comments

Comments
 (0)