CalcBinding icon indicating copy to clipboard operation
CalcBinding copied to clipboard

object reference not set to an instance of an object

Open LucaFagan opened this issue 5 years ago • 4 comments

I keep getting "object reference not set to an instance of an object" worning in xaml designer even if the application works fine.

If I replace win:Visibility.Visible and win:Visibility.Collapsed with numeric values the error goes away so I thing the error is related to the name space. Any solution ?

xmlns:win="clr-namespace:System.Windows;assembly=PresentationCore"

Visibility="{c:Binding '(JobParamsOtt.MULTIPLY_RIP_TYPE == 1) ? win:Visibility.Visible : win:Visibility.Collapsed'}">

LucaFagan avatar Oct 27 '20 22:10 LucaFagan

Try this :

xmlns:win="clr-namespace:System.Windows;assembly=PresentationCore"

Visibility="{c:Binding '(JobParamsOtt.MULTIPLY_RIP_TYPE == 1)'}">

If the condition is met, it wil be visible by default

keytrap-x86 avatar Dec 13 '20 21:12 keytrap-x86

I've tried the suggested approach, if condition is met the field is visible, otherwise it is collapsed.

LucaFagan avatar Dec 13 '20 22:12 LucaFagan

I've tried the suggested approach, if condition is met the field is visible, otherwise it is collapsed.

I've edited my answer. I meant visible by default

keytrap-x86 avatar Dec 13 '20 22:12 keytrap-x86

Ah ok.

Thanks for the explanation.

LucaFagan avatar Dec 13 '20 22:12 LucaFagan