Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
24012f3
Implement `[BindableProperty]` for MediaElement
ne0rrmatrix Nov 7, 2025
4fce518
Merge branch 'main' into Use-BindableProperty-for-MediaElement
ne0rrmatrix Nov 7, 2025
81a4aef
Fix merge
ne0rrmatrix Nov 23, 2025
f33a384
Fix `AndroidViewType` setter error
ne0rrmatrix Nov 23, 2025
3b5f5db
Merge branch 'Use-BindableProperty-for-MediaElement' of https://githu…
ne0rrmatrix Nov 23, 2025
b8fc575
Fix unintended changes
ne0rrmatrix Nov 23, 2025
1cd0221
fix
ne0rrmatrix Nov 23, 2025
d13fad9
Fix bindable Properties and summaries
ne0rrmatrix Nov 23, 2025
dbaa965
Fix `AutoPlay` default value
ne0rrmatrix Nov 23, 2025
159414d
Apply suggestion from @Copilot
ne0rrmatrix Nov 23, 2025
1386b29
Apply suggestion from @Copilot
ne0rrmatrix Nov 23, 2025
632f43e
Fix `Aspect` setter for ReadOnly
ne0rrmatrix Nov 23, 2025
9c3d965
Apply suggestion from @Copilot
ne0rrmatrix Nov 23, 2025
0f0c460
Fix `CurrentState` private setter
ne0rrmatrix Nov 23, 2025
eaec5d4
Fix merge conflicat
ne0rrmatrix Nov 23, 2025
496fade
Apply suggestion from @Copilot
ne0rrmatrix Nov 23, 2025
a7e6f29
Apply suggestion from @Copilot
ne0rrmatrix Nov 23, 2025
679a69a
Apply suggestion from @Copilot
ne0rrmatrix Nov 23, 2025
75f39ae
Fix `ValidateVolume`
ne0rrmatrix Nov 23, 2025
85505c2
Update src/CommunityToolkit.Maui.MediaElement/MediaElement.shared.cs
ne0rrmatrix Nov 23, 2025
b586463
Fix tests
ne0rrmatrix Nov 23, 2025
877055f
Refactor MediaElement with BindableProperty attribute
ne0rrmatrix Nov 23, 2025
5e8c518
Refactor BindableProperty generation and property access
ne0rrmatrix Nov 23, 2025
ff4ef99
Comment out compiler-generated files settings
ne0rrmatrix Nov 23, 2025
0911d53
Enhance attribute handling in source generator
ne0rrmatrix Nov 23, 2025
8b5e834
Fix `MediaElement.Position` accessor
ne0rrmatrix Nov 23, 2025
1c47ef5
Refactor BindableProperty key usage and access control
ne0rrmatrix Nov 23, 2025
abdf13f
Fix Text property to use BindablePropertyKey
ne0rrmatrix Nov 23, 2025
edd4ab5
merge Main into PR
ne0rrmatrix Nov 24, 2025
e1b29a4
Update src/CommunityToolkit.Maui.SourceGenerators.Internal.UnitTests/…
ne0rrmatrix Nov 24, 2025
afcf4cd
Fix comments
ne0rrmatrix Nov 24, 2025
2951486
Merge branch 'Use-BindableProperty-for-MediaElement' of https://githu…
ne0rrmatrix Nov 24, 2025
401f7c2
Fix comments
ne0rrmatrix Nov 24, 2025
22354bd
Merge branch 'main' into Use-BindableProperty-for-MediaElement
ne0rrmatrix Nov 24, 2025
bf82131
Update src/CommunityToolkit.Maui.SourceGenerators.Internal/Generators…
ne0rrmatrix Nov 24, 2025
17f611f
Refactor bindable property generation logic
ne0rrmatrix Nov 25, 2025
893b98a
Merge branch 'main' into Use-BindableProperty-for-MediaElement
ne0rrmatrix Nov 25, 2025
7b0fff3
Refactor AttributeExtensions and add new helper method
ne0rrmatrix Nov 25, 2025
b92eb7a
Fix merge
ne0rrmatrix Nov 25, 2025
8739bb2
Merge branch 'main' into Use-BindableProperty-for-MediaElement
ne0rrmatrix Nov 29, 2025
d5d1004
Update Formatting
TheCodeTraveler Nov 29, 2025
7325284
Create MediaElementDefaults, Update Formatting
TheCodeTraveler Nov 29, 2025
1069156
Update Formatting
TheCodeTraveler Nov 29, 2025
1073cce
Add Missing Unit Tests
TheCodeTraveler Nov 29, 2025
95d815f
Update Enum Support
TheCodeTraveler Nov 29, 2025
ce0d27e
Add Long Enum Test
TheCodeTraveler Nov 29, 2025
02c7056
Fix enum support
TheCodeTraveler Nov 30, 2025
5f94418
Add support for all setter types
TheCodeTraveler Nov 30, 2025
770cae4
Use `is not null`
TheCodeTraveler Nov 30, 2025
0d08070
Fix namespace
TheCodeTraveler Nov 30, 2025
69990b9
Fix nullable
TheCodeTraveler Nov 30, 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 @@ -18,7 +18,7 @@
Text="This page demonstrates that the MediaElement can be used inside of a DataTemplate"
Margin="12,0,12,0"/>
<CarouselView HeightRequest="275" PeekAreaInsets="52" ItemsSource="{Binding ItemSource}">

<CarouselView.ItemsLayout>
<LinearItemsLayout Orientation="Horizontal"
ItemSpacing="24"
Expand Down Expand Up @@ -55,18 +55,18 @@
</Border>
</DataTemplate>
</CarouselView.ItemTemplate>

</CarouselView>

<Label HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
HorizontalOptions="Center"
VerticalOptions="Center"
Text="Second CarouselView to confirm MediaElement can be used on a Page containing multiple ItemsView controls"
Margin="12,0,12,0"/>

<CarouselView HeightRequest="275" PeekAreaInsets="52" ItemsSource="{Binding ItemSource}">

<CarouselView.ItemsLayout>
<LinearItemsLayout Orientation="Horizontal"
ItemSpacing="24"
Expand Down Expand Up @@ -102,15 +102,15 @@
</Border>
</DataTemplate>
</CarouselView.ItemTemplate>

</CarouselView>

<Label Text="Swipe Left or Right to see next video"
HorizontalOptions="Center"
VerticalOptions="Center"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontAttributes="Italic"/>

</VerticalStackLayout>
</pages:BasePage>
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,55 @@
Padding="0, 20, 0, 0"
Title="MediaElement in CollectionView">
<ScrollView>
<VerticalStackLayout Spacing="12">
<Label HorizontalTextAlignment="Center"
<VerticalStackLayout Spacing="12">
<Label HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
HorizontalOptions="Center"
VerticalOptions="Center"
Text="This page demonstrates that the MediaElement can be used inside of a DataTemplate"
Margin="12,0,12,0"/>
<CollectionView HeightRequest="850" ItemsSource="{Binding ItemSource}">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
<CollectionView HeightRequest="850" ItemsSource="{Binding ItemSource}">

<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="1"
SnapPointsAlignment="Center"
SnapPointsType="MandatorySingle" />
</CollectionView.ItemsLayout>
</CollectionView.ItemsLayout>

<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MediaElementDataSource">
<Border
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MediaElementDataSource">
<Border
x:Name="CollectionViewBorder"
BackgroundColor="Black"
Padding="5">
<Border.StrokeShape>
<RoundRectangle CornerRadius="4" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="6" HeightRequest="250">
<toolkit:MediaElement
<Border.StrokeShape>
<RoundRectangle CornerRadius="4" />
</Border.StrokeShape>
<VerticalStackLayout Spacing="6" HeightRequest="250">
<toolkit:MediaElement
HeightRequest="200"
x:Name="MediaElement"
ShouldAutoPlay="True"
ShouldShowPlaybackControls="True"
Source="{Binding Source, Mode=OneTime}" />
<Label TextColor="White"
<Label TextColor="White"
HorizontalOptions="Center"
VerticalOptions="Center"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontAttributes="Bold"
FontSize="18"
Text="{Binding Name, Mode=OneTime}"/>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>

</CollectionView>

</VerticalStackLayout>

</ScrollView>

</pages:BasePage>
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,19 @@
<Configurations>Debug;Release</Configurations>
<WarningsAsErrors>$(WarningsAsErrors);CS1591</WarningsAsErrors>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GeneratedFiles</CompilerGeneratedFilesOutputPath>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\build\nuget.png" PackagePath="icon.png" Pack="true" />
<None Include="ReadMe.txt" pack="true" PackagePath="." />
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\CommunityToolkit.Maui.SourceGenerators.Internal\CommunityToolkit.Maui.SourceGenerators.Internal.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
<None Include="..\CommunityToolkit.Maui.MediaElement.Analyzers\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Maui.MediaElement.Analyzers.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="..\CommunityToolkit.Maui.MediaElement.Analyzers.CodeFixes\bin\$(Configuration)\netstandard2.0\CommunityToolkit.Maui.MediaElement.Analyzers.CodeFixes.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@ namespace CommunityToolkit.Maui.Core;
public interface IMediaElement : IView, IAsynchronousMediaElementHandler
{
/// <summary>
/// Gets or sets the title of the media.
/// </summary>
string MetadataTitle { get; set; }

/// <summary>
/// Gets or sets the artist of the media.
/// Occurs when <see cref="CurrentState"/> changed.
/// </summary>
string MetadataArtist { get; set; }
event EventHandler<MediaStateChangedEventArgs> StateChanged;

/// <summary>
/// Gets or sets the artwork Image Url.
/// Occurs when the <see cref="Position"/> changes;
/// </summary>
string MetadataArtworkUrl { get; set; }

event EventHandler<MediaPositionChangedEventArgs> PositionChanged;
/// <summary>
/// Gets the media aspect ratio.
/// </summary>
Expand Down Expand Up @@ -98,18 +93,23 @@ public interface IMediaElement : IView, IAsynchronousMediaElementHandler
/// <summary>
/// Gets or sets the volume of the audio for the media.
/// </summary>
/// <remarks>A value of 1 means full volume, 0 is silence.</remarks>
/// <remarks>A value of 1 indicates full volume, 0 is silence.</remarks>
double Volume { get; set; }

/// <summary>
/// Gets or sets the title of the media.
/// </summary>
string MetadataTitle { get; set; }

/// <summary>
/// Occurs when <see cref="CurrentState"/> changed.
/// Gets or sets the artist of the media.
/// </summary>
event EventHandler<MediaStateChangedEventArgs> StateChanged;
string MetadataArtist { get; set; }

/// <summary>
/// Occurs when the <see cref="Position"/> changes;
/// Gets or sets the artwork Image Url.
/// </summary>
event EventHandler<MediaPositionChangedEventArgs> PositionChanged;
string MetadataArtworkUrl { get; set; }

/// <summary>
/// Occurs when the media has ended playing successfully.
Expand Down
Loading
Loading