Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MediaElement Transport Controls for Windows #2329

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a55e456
Add custom transport controls and resource dictionary
ne0rrmatrix Sep 27, 2024
2188130
Reorder AppBarSeparator in ResourceDictionary.xaml
ne0rrmatrix Sep 28, 2024
8add2c7
Re-add and enhance media control styles and templates
ne0rrmatrix Sep 28, 2024
6a1784d
Update layout properties and add corner radius to Grid
ne0rrmatrix Sep 28, 2024
8f53f1d
Merge branch 'CommunityToolkit:main' into UpdateWindowsControls
ne0rrmatrix Oct 5, 2024
6e67369
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Nov 9, 2024
43e327c
Refactor CustomTransportControls class and clean up code
ne0rrmatrix Nov 9, 2024
58c6d87
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Nov 11, 2024
59eea8f
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Dec 2, 2024
28eb678
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Dec 12, 2024
6b6c1ba
Merge branch 'main' into UpdateWindowsControls
brminnick Dec 18, 2024
3799a84
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Dec 19, 2024
c4fe558
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Dec 20, 2024
d71d75a
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Dec 28, 2024
46a7519
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Jan 3, 2025
8d2a1d6
Merge branch 'main' into UpdateWindowsControls
vhugogarcia Jan 10, 2025
e9b5803
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Jan 10, 2025
a26d2b7
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Jan 13, 2025
8c7597d
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Jan 14, 2025
54826e3
Merge branch 'main' into UpdateWindowsControls
jfversluis Jan 17, 2025
757288f
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Jan 20, 2025
5525b43
Merge branch 'main' into UpdateWindowsControls
ne0rrmatrix Jan 21, 2025
f7b6339
Fix volume slider bug with Should Mute
ne0rrmatrix Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,9 @@
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiPackageVersion)"/>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="ResourceDictionary.windows.xaml">
<LogicalName>ResourceDictionary.windows.xaml</LogicalName>
</EmbeddedResource>
</ItemGroup>
</Project>
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;
}
}
}
Loading
Loading