I have a grid that I want a popup to show in a constant relation to it regardless of the size of both the popup and the grid. I use a converter for it here is the code
< Grid Name=YParamTextBlock>
<TextBlock HorizontalAlignment="Center"/>
<Popup PlacementTarget="{Binding ElementName=YParamTextBlock}} Placement="Center">
<Popup.VerticalOffSet>
<MultiBinding Mode="OneWay" Converter="{StaticResource OffsetConverter} NotifyOnTargetChanged="True">
<Binding Mode="OneWay" ElementName="YParamTextBlock" Path="ActualHeight" NotifyOnTargetUpdated="True"/>
<Binding Mode="OneWay" RelativeSource={RelativeSource Self} Path="ActualHeight" NotifyOnTargetChanged="True"/>
</MultiBinding>
</Popup.VerticalOffset>
</Popup>
<Grid>
The problem is that the actual height is 0.0 for the two controls when they are first created, so I added the NotifyOnTargetChanged in order to fix it. Now, for some reason the NotifyOnTargetChanged fixed the rebinding for the Grid's ActualHeight, but the Popup is still 0.0. Is there anyway to notify the popup actual height has changed? Or any other solution for this issue?