1

I am trying to bind a view model variable with label's enabled property but it crashes the app

bindings.Add(this.SetBinding(() => this.Vm.IsEnabled, () => this.lblDate.Enabled, BindingMode.TwoWay));

The crash is always reproducible in release mode.

enter image description here

Here is the crash report

Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241

1 Answers1

0

It looks like the Enabled property of lblDate doesn't have a public setter, but being a control I am almost sure it has. I found on this page that one solution would be to add the [Preserve] attribute to your property in view-model

Madalin Sisu
  • 92
  • 1
  • 12