I have this:
<TabControl Margin="0,24,0,0">...</TabControl>
I want to bind only the "Top" part of the TabControl, which intuitively I would do it this way:
<TabControl Margin="0,{Binding ElementName=TheMenu, Path=Height},0,0">
...
</TabControl>
How do I do it ?
Have you tried using a converter like this?
in VB.Net
Or in C#
XAML
Edit:
Using a MultiConverter
It is also possible to get all four values during run-time and use a MultiValueConverter. The Top-Property of the Thickness-Object is not a Dependency-Object, therefor you can’t define a binding to it (unless your source is not a Dependency-Object).
XAML
… and c#
Edit(2) Reverse-Binding:
I’m not sure if this will make you happy. In my humble opinion I would try to avoid this, but ok… If your source is a Dependency-Property, you can bind this to the Margin:
But I’ve got some effects with this.
The trick is, that you do not bind a part of the Margin of your TabControl to “something else”, but bind “something else” to the Margin of your TabControl and specify Binding-Mode OneWayToSource.