Is there a way to determine the size and position of the visible area of a control in Silverlight, when the control is somewhere in a scroll viewer?
I have a control that is inside a grid at some Row and Column. The grid is inside a scroll viewer. The scroll viewer has fixed width and height. The grid's width and height are greater that those of the scroll viewer. At some point my control is only partially visible because of the scrolling.
I have a rectangle in a popup that I need to place above my control开发者_如何学Python, when the mouse is over it. I need to make the rectangle size to be exactly as the visible part of my control.
How can I do that?
Thanks.
I don't think so.... here is a part of the code in the page using the control
<ScrollViewer x:Name="ScrollHor" VerticalScrollBarVisibility="Auto" Margin="17 215 0 0" Height="100" Grid.Row="1" Grid.Column="1">
<StackPanel Height="Auto">
<Grid x:Name="grdTimeline">
<!-- Used to add dynamically controls-->
</Grid>
</StackPanel>
</ScrollViewer>
and what look the xaml of the control
<Grid x:Name="LayoutRoot" MouseLeftButtonUp="LayoutRoot_MouseLeftButtonUp">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="labelColumn" Width="100" />
<ColumnDefinition x:Name="mainColumn" Width="auto" />
<ColumnDefinition x:Name="buttonColumn" Width="30" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition x:Name="rowHeader" Height="30"/>
<RowDefinition x:Name="businessRow" Height="Auto"/>
</Grid.RowDefinitions>
.....
</Grid>
Thanksfor answer and best regards,
精彩评论