Two ways binding NullReferenceException
See original GitHub issueConfiguration
Name | Version |
---|---|
dotnet tool | 5.0.302 |
target framework | net452, net461, net472 |
Problem
When I use background binding, provided Path
, Source
and set mode TwoWay
, always throw NullReferenceException , but in net5.0 no exception, but how can i do when in NET Framework?
Whether i use SetBinding
or BindingOperations.SetBinding
.
StackTrack
at MS.Internal.AvTrace.AntiFormat(String s)
Code
var q = new Binding();
q.Path = new PropertyPath("RotateTransform");
q.Source = obj.RotateTransformDesigner;
q.Mode = BindingMode.TwoWay;
Bd.SetBinding(Control.RenderTransformProperty, q);
BindingOperations.SetBinding(Bd, Control.RenderTransformProperty, q);//ERROR
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
wpf - TwoWay mode binding scenario for null or empty data ...
The behavior of the string type seems fine to me. Two way binding means that the value in the textbox reflects the value...
Read more >Two-way binding not work with non-null assertion operator
But when I add a non-null assertion operator to the two-way binding value, the compilation result does not meet expectations.
Read more >2way binding on input but still show if null : r/Angular2
Say I have a 2 way binding like this: <input id="account-input-number" type="tel" [(ngModel)]="selectedAccount.username"/>.
Read more >Binding.TargetNullValue Property (Windows.UI.Xaml.Data)
TargetNullValue might be used for bindings that bind a collection and the source data uses null for missing info only in some of...
Read more >ASP.NET Core Blazor data binding
Two -way binding to a property with get / set accessors requires discarding the Task returned by EventCallback.InvokeAsync. For two-way data ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found!!!
It will given null value!
The code
@singhashish-wpf @miloush @SamBent @lindexi
I’m sorry that the original project can’t be provided, but I’m trying to write a sample. Please wait me some days. Thanks.
The StackTrace is here
VS show error line
designUnits
type isObservableCollection<T>
,unit
is a normal clr object, but it contains a Bound instance and a UIElement properties.VS Version
VS 2019 Communtity 16.10.4