CommunityToolkit / Microsoft.Toolkit.Win32

ARCHIVE - This repository contained XAML Islands wrapper controls and tooling for XAML Islands with WinUI 2, see readme for more info about XAML Islands with WinUI 3 and the WindowsAppSDK.
https://aka.ms/windowsappsdk
Other
384 stars 89 forks source link

Microsoft.Toolkit.Wpf.UI.Controls.MediaPlayerElement Binding Error #344

Closed ALittleDruid closed 1 year ago

ALittleDruid commented 2 years ago

Describe the bug

protected override void OnInitialized(EventArgs e) { // Bind dependency properties across controls // properties of FrameworkElement Bind(nameof(Style), StyleProperty, windows.UI.Xaml.Controls.MediaPlayerElement.StyleProperty); Bind(nameof(MaxHeight), MaxHeightProperty, windows.UI.Xaml.Controls.MediaPlayerElement.MaxHeightProperty); Bind(nameof(FlowDirection), FlowDirectionProperty, windows.UI.Xaml.Controls.MediaPlayerElement.FlowDirectionProperty); ... }

https://github.com/CommunityToolkit/Microsoft.Toolkit.Win32/blob/6fb2c3e00803ea563af20f6bc9363091b685d81f/Microsoft.Toolkit.Wpf.UI.Controls/MediaPlayerElement/MediaPlayerElement.cs#L39

NuGet Package(s): 6.1.2

Package Version(s):

Additional context

Bind(nameof(Style), StyleProperty, windows.UI.Xaml.Controls.MediaPlayerElement.StyleProperty);

The First two parameters is System.Windows.Style and System.Windows.StyleProperty, which can not binding with Windows.UI.Xaml.Style and Windows.UI.Xaml.Property whithout Converter.

Margin HorizontalAlignment VerticalAlignment ... etc

the error output

System.Windows.Data Error: 1 : Cannot create default converter to perform 'one-way' conversions between types 'Windows.UI.Xaml.Style' and 'System.Windows.Style'. Consider using Converter property of Binding. BindingExpression:Path=Style; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'Style' (type 'Style') System.Windows.Data Error: 1 : Cannot create default converter to perform 'one-way' conversions between types 'Windows.UI.Xaml.FlowDirection' and 'System.Windows.FlowDirection'. Consider using Converter property of Binding. BindingExpression:Path=FlowDirection; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'FlowDirection' (type 'FlowDirection') System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property. FlowDirection:'LeftToRight' BindingExpression:Path=FlowDirection; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'FlowDirection' (type 'FlowDirection') System.Windows.Data Error: 1 : Cannot create default converter to perform 'one-way' conversions between types 'Windows.UI.Xaml.Thickness' and 'System.Windows.Thickness'. Consider using Converter property of Binding. BindingExpression:Path=Margin; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'Margin' (type 'Thickness') System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property. Thickness:'0,0,0,0' BindingExpression:Path=Margin; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'Margin' (type 'Thickness') System.Windows.Data Error: 1 : Cannot create default converter to perform 'one-way' conversions between types 'Windows.UI.Xaml.HorizontalAlignment' and 'System.Windows.HorizontalAlignment'. Consider using Converter property of Binding. BindingExpression:Path=HorizontalAlignment; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'HorizontalAlignment' (type 'HorizontalAlignment') System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property. HorizontalAlignment:'Stretch' BindingExpression:Path=HorizontalAlignment; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'HorizontalAlignment' (type 'HorizontalAlignment') System.Windows.Data Error: 1 : Cannot create default converter to perform 'one-way' conversions between types 'Windows.UI.Xaml.VerticalAlignment' and 'System.Windows.VerticalAlignment'. Consider using Converter property of Binding. BindingExpression:Path=VerticalAlignment; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'VerticalAlignment' (type 'VerticalAlignment') System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property. VerticalAlignment:'Stretch' BindingExpression:Path=VerticalAlignment; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'VerticalAlignment' (type 'VerticalAlignment') System.Windows.Data Error: 1 : Cannot create default converter to perform 'one-way' conversions between types 'Windows.UI.Xaml.Media.Stretch' and 'Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.Stretch'. Consider using Converter property of Binding. BindingExpression:Path=Stretch; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'Stretch' (type 'Stretch') System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property. Stretch:'None' BindingExpression:Path=Stretch; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'Stretch' (type 'Stretch') System.Windows.Data Error: 1 : Cannot create default converter to perform 'one-way' conversions between types 'Windows.UI.Xaml.Media.ImageSource' and 'Microsoft.Toolkit.Win32.UI.Controls.Interop.WinRT.ImageSource'. Consider using Converter property of Binding. BindingExpression:Path=PosterSource; DataItem='MediaPlayerElement' (HashCode=55101221); target element is 'MediaPlayerElement' (Name='mediaPlayerElement'); target property is 'PosterSource' (type 'ImageSource')

ghost commented 2 years ago

Hello ALittleDruid, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback πŸ™Œ

ghost commented 2 years ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 2 years ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 2 years ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 2 years ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 2 years ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 2 years ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 2 years ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 2 years ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 2 years ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 2 years ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 2 years ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 1 year ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.

ghost commented 1 year ago

This issue has been marked as "needs attention πŸ‘‹" due to no activity for 15 days. Please triage the issue so the fix can be established.