I'm trying to do something apparently easy but I don't know why is not working.
This works fine:
<TextBox DataContext="{Binding ElementName=CORDONES_ESTATALESDomainDataSource, Path=Data}" Text="{Binding Path=DNA_A1}">
<ToolTipService.ToolTip>
<ToolTip Content="{Binding Path=DNA_A1}"/>
</ToolTipService.ToolTip>
</TextBox>
I'm showing the same content in the tooltip than in the textbox. On the contrary:
<TextBox DataContext="{Binding ElementName=CORDONES_ESTATALESDomainDataSource, Path=Data}" Text="{Binding Path=DNA_A1}">
<ToolTipService.ToolTip>
<ToolTip DataContext="{Binding ElementName=TIPAJES_INTERMEDIOSDomainDataSource, Path=Data}" Content="{Binding Path=ALELOS_DNA_A2}"/>
</ToolTipService.ToolTip>
</TextBox>
This shows nothing. Note that the only change is that the tooltip has a different DataContext because the domaindatasource is also different.
Why is this happening? Am I doing something wrong or is it impossible to do? Is it because the different datacontexts? If this is not the way, how can I do this?
Thanks
I didn't find a way to do it work so I solved the following way.
<TextBox DataContext="{Binding ElementName=CORDONES_ESTATALESDomainDataSource, Path=Data}" Text="{Binding Path=DNA_A1}">
<ToolTipService.ToolTip>
<ToolTip Name="DNA_A1Tooltip" Content=""/>
</ToolTipService.ToolTip>
I set the content to "" and I assign the tooltip a name. Then in the currentChanged event of the domain datasource I assign programaticaly the value its content:
DNA_A1Tooltip.Content = TIPAJES_INTERMEDIOSDomainDataSource.DataView.CurrentItem.ALELOS_DNA_A1()
I know it's not the most elegant solution but it works.