Skip to content

Commit 353eed7

Browse files
committed
Ensure new tabs recieve correct IShellPage instance
1 parent 060929c commit 353eed7

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

Files/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public static IShellPage CurrentInstance
4040
}
4141
set
4242
{
43-
if(value != currentInstance)
43+
if(value != currentInstance && value != null)
4444
{
4545
currentInstance = value;
4646
}

Files/Controls/RibbonArea.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,7 @@
18491849
Height="32.5"
18501850
Padding="2.5,0,0,0"
18511851
HorizontalAlignment="Stretch"
1852-
VerticalAlignment="Stretch"
1852+
VerticalAlignment="Center"
18531853
BorderBrush="{ThemeResource TextBoxBorderThemeBrush}"
18541854
BorderThickness="1"
18551855
CornerRadius="2"
@@ -1867,15 +1867,15 @@
18671867
x:Name="PathViewInteract"
18681868
x:FieldModifier="public"
18691869
Margin="0"
1870-
VerticalAlignment="Center"
1870+
VerticalAlignment="Stretch"
18711871
HorizontalContentAlignment="Stretch"
18721872
VerticalContentAlignment="Stretch"
18731873
Background="{ThemeResource TextControlBackground}"
18741874
CanReorderItems="False"
18751875
IsItemClickEnabled="True"
18761876
ItemClick="PathViewInteract_ItemClick"
18771877
ItemContainerStyle="{StaticResource ListViewItemContainerStyle_NoRevealBorder}"
1878-
ItemsSource="{x:Bind local:App.CurrentInstance.PathComponents}"
1878+
ItemsSource="{x:Bind local:App.CurrentInstance.PathComponents, Mode=OneWay}"
18791879
ScrollViewer.HorizontalScrollBarVisibility="Auto"
18801880
ScrollViewer.HorizontalScrollMode="Enabled"
18811881
ScrollViewer.VerticalScrollBarVisibility="Disabled"

Files/ProHome.xaml.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ public ProHome()
130130
App.AppSettings.DrivesManager.ShowUserConsentOnInit = false;
131131
DisplayFilesystemConsentDialog();
132132
}
133+
134+
App.CurrentInstance = this as IShellPage;
133135
}
134136

135137
private async void DisplayFilesystemConsentDialog()
@@ -150,10 +152,7 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
150152

151153
private void Page_Loaded(object sender, RoutedEventArgs e)
152154
{
153-
if (App.CurrentInstance == null && ItemViewModel.GetCurrentSelectedTabInstance<ProHome>().Equals(this))
154-
{
155-
App.CurrentInstance = this as IShellPage;
156-
}
155+
157156

158157
viewModel = new ItemViewModel();
159158
interactionOperation = new Interaction();

0 commit comments

Comments
 (0)