0

BindableTranslateManipulator

Fam Wired 4 years ago in Question updated by Hypo Dyne 3 years ago 4

It's easy to reproduce this, just add two tabitems with different helixviewports.


xaml code:

        <TabControl>            <TabItem Header="Tab1">
                <h:HelixViewport3D>
                    <h:BoxVisual3D x:Name="box1" Center="-3.5,0,1" Height="3" Fill="Silver"/>
                    <h:TranslateManipulator Color="Blue" Position="-3.5,0,1" Offset="0,0,1.5" Length="1" Value="{Binding Height, ElementName=box1, Converter={StaticResource Multiplier}}" Direction="0,0,1"/>
                </h:HelixViewport3D>
            </TabItem>
            <TabItem Header="Tab2">
                <h:HelixViewport3D>
                    <h:BoxVisual3D x:Name="box2" Center="-3.5,0,1" Height="3" Fill="Silver"/>
                    <h:TranslateManipulator Color="Red" Position="-3.5,0,1" Offset="0,0,1.5" Length="1" Value="{Binding Height, ElementName=box2, Converter={StaticResource Multiplier}}" Direction="0,0,1"/>
                </h:HelixViewport3D>
            </TabItem>
        </TabControl>

It works perfect in the first tabitem, but in the second tabItem I got binding error:


Cannot find source for binding with reference 'ElementName=box1'. BindingExpression:Path=Height; DataItem=null; target element is 'TranslateManipulator' (HashCode=28505784); target property is 'Value' (type 'Double')


Does anyone have a workaround or solution for this issue??


Thanks!

F Wired


WPF

Correction: Binding error: box2 instead of box1 in the specific case above.

I think its to do with the Tab Control. See if it works outside of the tab control.