We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4558bc2 commit c64b914Copy full SHA for c64b914
src/Files.App/Data/Models/AppModel.cs
@@ -43,8 +43,10 @@ public int TabStripSelectedIndex
43
if (value >= 0 && value < MainPageViewModel.AppInstances.Count)
44
{
45
var rootFrame = (Frame)MainWindow.Instance.Content;
46
- var mainView = (MainPage)rootFrame.Content;
47
- mainView.ViewModel.SelectedTabItem = MainPageViewModel.AppInstances[value];
+ if (rootFrame.Content is MainPage mainView)
+ {
48
+ mainView.ViewModel.SelectedTabItem = MainPageViewModel.AppInstances[value];
49
+ }
50
}
51
52
catch (COMException)
0 commit comments