Skip to content

Commit edd464a

Browse files
Use Pattern Matching, Fix Variable Name
1 parent 951587b commit edd464a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/CommunityToolkit.Maui.MediaElement/Primitives/CustomTransportControls.windows.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ protected override void OnApplyTemplate()
1717
{
1818
base.OnApplyTemplate();
1919

20-
var temp = GetTemplateChild("FullWindowButton") as AppBarButton;
21-
if (temp is not null)
20+
if (GetTemplateChild("FullWindowButton") is AppBarButton appBarButton)
2221
{
23-
FullScreenButton = temp;
22+
FullScreenButton = appBarButton;
2423
FullScreenButton.Visibility = Microsoft.UI.Xaml.Visibility.Visible;
2524
OnTemplateLoaded?.Invoke(this, EventArgs.Empty);
2625
FullScreenButton.Click += FullScreenButton_Click;

0 commit comments

Comments
 (0)