Alex141 / CalcBinding

Advanced WPF Binding which supports expressions in Path property and other features

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

object reference not set to an instance of an object

LucaFagan opened this issue · 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'}">

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

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

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

Ah ok.

Thanks for the explanation.