I have custom control (not user control) which inherits from ContentControl
.
Its default style:
<Style TargetType="{x:Type views:DialogCustomControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type views:DialogCustomControl}">
<Grid>
<Border Width="40">
<ContentPresenter Content="{TemplateBinding IconContent}" />
</Border>
I need it to be 40 if IconContent
is not null and 0 otherwise.
I know how to make it work in code with dep prop. But I am pretty sure it is also possible declaratively.