How can I always position a silverlight control on screen at the same location regardless of the text-box the client changes focus to? Basically I have a header banner that I want visible at all times. When the client changes focus to a text-box, I want all the content to scroll to bring the text-box into center view(this is the default behavior) except for the banner which should always displayed at (0,0) screen coordinates. What I have so far for the layout is:
<Grid x:Name="LayoutRoot"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="80" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Name="myBanner"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Height="80"
Width="480" />
<TextBox Grid.Row="2"
Name="textBox1"
Text="TextBox"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Height="72"
Width="480"
/> <--- Even when client focuses on this I want myBanner to be visible at (0,0) screen coordinate
</Grid>
An example of this can been seen in the texting app on the phone. Regardless of if the client has focused to text message writing text-box the title at the top "John Doe, Text" appears at the same position all the time.
Thanks again for any help.
Try this
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<!-- Your banner goes here-->
<TextBlock Text="some text" />
<ScrollViewer Grid.Row="1">
<!-- Your content goes here-->
</ScrollViewer>
</Grid>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.