Hello everybody,
I have a custom panel that has a public dependency property MaxItemsCount(defines the maximum number of elements in the panel), and I am giving this panel as an ItemsPanel to my custom control.
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<myPrimitives:MyPanel MaxItemsCount="5"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
I also have a public dependency property in my custom control called MaxItemsCount as well.
Is there a way to bind the MaxItemsCount of my panel to the MaxItemsCount of my custom control.
I tried doing the following:
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<myPrimitives:MyPanel MaxItemsCount="{TemplateBinding MaxItemsCount}"/>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
...but apparently it's not how it's done.
Any help would be greatly appreciated!