Default Visibility enum contains
Collapsed
Hidden
Visible
I need another one name NotCreatable
. When set Visibility to Notcreatable, current Element must not created on view level.
Because I have 2 class inherits from A
public Class B:A
{ Property B1;}
public Class C:A
{ Property C1;}
my xaml
<stackpanel DataContext="{Binding objectA}">
<stackpanel Visiblity="{Binding isB,Converter={StaticResource Bool2Visible}}">
<textbox text="{Binding B1}"/>
</stackpanel>
<Grid Visiblity="{Binding isC,Converter={StaticResource Bool2Visible}}">
<ItemsControl Itemssource="{Binding C1}"/>
</Grid>
</stackpanel>
Sometimes objectA is B, sometimes objectA is C. But my problem is when isC==true ,
First Stackpanel successfully hidden. But binding works. Following error shown
System.Windows.Data Error: 40 : BindingExpression path error: 'B1' property not found on 'object' 'C'