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

Error in binding SpeedRatio & Volume #627

Closed
2 tasks done
TMS-Namespace opened this issue Jul 20, 2022 · 1 comment
Closed
2 tasks done

Error in binding SpeedRatio & Volume #627

TMS-Namespace opened this issue Jul 20, 2022 · 1 comment
Labels

Comments

@TMS-Namespace
Copy link

TMS-Namespace commented Jul 20, 2022

Issue Title (Error in binding SpeedRatio & Volume)

Although binding other properties works fine, and those two seems to be dependency properties, and they do work if set programmatically, WPF binding and the designer throws an exception (Object reference not set to an instance of an object, see below), and during run time (compiles with no issues), no value changes takes place (in either directions).

Issue Categories

  • [*] Bug

Version Information

  • NuGet Package 4.4.350
  • Visual Studio 2022, .Net Framework 6 (same behavior with .Net Framework 5)

Sample Code

XAML

image

Stack trace from the WPF designer

at Unosquare.FFME.MediaElement.OnSpeedRatioPropertyChanging(DependencyObject d, Object value) at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, Object controlValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, Boolean skipBaseValueChecks) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue) at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp) at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange) at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange) at System.Windows.Data.BindingExpression.Activate(Object item) at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt) at System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance) at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance) at MS.Internal.Data.DataBindEngine.Run(Object arg) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

@kuangxj
Copy link

kuangxj commented Jan 14, 2023

It's work for me,do it.

<ffme:MediaElement
                x:Name="player"
             
                Panel.ZIndex="0"
                IsDesignPreviewEnabled="True"
                LoadedBehavior="Play"
                Stretch="Fill"
                UnloadedBehavior="Manual"
                Volume="{Binding ElementName=sliderVolume, Path=Value, Mode=TwoWay}" />
<Slider
                                x:Name="sliderVolume"
                                Width="100"
                                Maximum="1"                    
                                TickFrequency=".01"
                                Value="1" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants