-
Notifications
You must be signed in to change notification settings - Fork 417
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into FullScreenEvents
- Loading branch information
Showing
7 changed files
with
921 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/CommunityToolkit.Maui.MediaElement/Primitives/CustomTransportControls.windows.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Controls; | ||
namespace CommunityToolkit.Maui.Primitives; | ||
|
||
sealed partial class CustomTransportControls : MediaTransportControls | ||
{ | ||
public event EventHandler<EventArgs>? OnTemplateLoaded; | ||
public AppBarButton FullScreenButton = new(); | ||
bool isFullScreen = false; | ||
|
||
public CustomTransportControls() | ||
{ | ||
this.DefaultStyleKey = typeof(CustomTransportControls); | ||
} | ||
|
||
protected override void OnApplyTemplate() | ||
{ | ||
base.OnApplyTemplate(); | ||
|
||
var temp = GetTemplateChild("FullWindowButton") as AppBarButton; | ||
if(temp is not null) | ||
{ | ||
FullScreenButton = temp; | ||
FullScreenButton.Visibility = Microsoft.UI.Xaml.Visibility.Visible; | ||
OnTemplateLoaded?.Invoke(this, EventArgs.Empty); | ||
FullScreenButton.Click += FullScreenButton_Click; | ||
} | ||
} | ||
|
||
void FullScreenButton_Click(object sender, RoutedEventArgs e) | ||
{ | ||
if (isFullScreen) | ||
{ | ||
FullScreenButton.Icon = new FontIcon { Glyph = "\uE740" }; | ||
isFullScreen = false; | ||
} | ||
else | ||
{ | ||
FullScreenButton.Icon = new SymbolIcon(Symbol.BackToWindow); | ||
isFullScreen = true; | ||
} | ||
} | ||
} |
799 changes: 799 additions & 0 deletions
799
src/CommunityToolkit.Maui.MediaElement/ResourceDictionary.windows.xaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters