tags:

views:

45

answers:

1

In a scenario like this:

<Grid>
...
   <local:MyControl x:Name="MyCtl" Grid.Row="1"/>
   <Popup PlacementTarget="{Binding ???}"/>
<Grid>

I need to bind PlacementTarget to a button named MyBtn within MyCtl. What is a cleanest way to do it?

A: 
<Popup PlacementTarget="{Binding ElementName=MyCtl}" />
qntmfred
i haven't tried it, but i would think this would work
qntmfred
Of course it would work - but the Popup would pop at MyCtl coordinates, not at MyBtn. If MyCtl is Window-aligned, but MyBtn is in the center of MyCtl, I want Popup to show at MyBtn coords.
Sergey Aldoukhov
oh i see, didn't read it close enough
qntmfred