Skip to content

Commit

Permalink
[Housekeeping] Remove Null Forgiving Operator (#2446)
Browse files Browse the repository at this point in the history
* Remove `!.`

* Update AppShell.xaml.cs
  • Loading branch information
TheCodeTraveler authored Jan 16, 2025
1 parent 1935da5 commit 9a11a1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 5 additions & 3 deletions samples/CommunityToolkit.Maui.Sample/AppShell.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,11 @@ void SetupNavigationView()
#if WINDOWS
Loaded += delegate
{
var navigationView = (Microsoft.UI.Xaml.Controls.NavigationView)flyout.Handler!.PlatformView!;
navigationView.IsPaneToggleButtonVisible = true;
navigationView.PaneDisplayMode = Microsoft.UI.Xaml.Controls.NavigationViewPaneDisplayMode.Auto;
if(flyout.Handler?.PlatformView is Microsoft.UI.Xaml.Controls.NavigationView navigationView)
{
navigationView.IsPaneToggleButtonVisible = true;
navigationView.PaneDisplayMode = Microsoft.UI.Xaml.Controls.NavigationViewPaneDisplayMode.Auto;
}
};
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,12 @@ void ProcessSelect(string selectedItem)
}
else if (isFileSelectionMode)
{
fileNameEntry!.Text = selectedItem;
if(fileNameEntry is null)
{
throw new InvalidOperationException($"{nameof(fileNameEntry)} cannot be null");
}

fileNameEntry.Text = selectedItem;
}
}

Expand Down

0 comments on commit 9a11a1f

Please # to comment.