How to create a border above the grid(named as Holder) for wp7? What i tried is, when i create the grid to full screen and after i created the border on the top of the screen but when i debug it, the border is not visible. Can anyone help me with this? Thanks in advance for your hard work!
<Grid x:Name="BrowserHost" GotFocus="BrowserHost_GotFocus" Grid.RowSpan="2">
<StackPanel x:Name="Stack" Background="Transparent">
<Border x:Name="Border" Background="{StaticResource PhoneAccentBrush}">
<TextBox x:Name="UrlTextBox" KeyDown="UrlTextBox_KeyDown" Background="White" Margin="0,0,98,0">
</Border>
</StackPanel>
MainPage xaml.cs
public partial class MainPage : PhoneApplicationPage
{
private const int NumTabs = 4;
private int currentIndex;
private string[] urls = new string[NumTabs];
private WebBrowser[] browsers = new WebBrowser[NumTabs];
public MainPage()
{
InitializeComponent();
ShowTab(0);
}
private void ShowTab(int index)
{
this.currentIndex = index;
UrlTextBox.Text = this.urls[this.currentIndex] ?? "";
if (this.browsers[this.currentIndex] == null)
{
WebBrowser browser = new WebBrowser();
this.browsers[this.currentIndex] = browser;
BrowserHost.Children.Add(browser);
}
for (int i = 0; i < NumTabs; i++)
{
if (this.browsers[i] != null)
{
this.browsers[i].Visibility = i == this.currentIndex ? Visibility.Visible : Visibility.Collapsed;
}
}
}
private void UrlTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
Uri url;
if (Uri.TryCreate(UrlTextBox.Text, UriKind.Absolute, out url))
{
this.urls[this.currentIndex] = UrlTextBox.Text;
this.browsers[this.currentIndex].Navigate(url);
}
else
MessageBox.Show("Invalid url");
}
}
But after i debug, neither the border nor UrlTextBox is visible.
Image:

I used the GotFocus event for the BrowserHost grid. That means, when i touched the grid(BrowserHost), the UrlTextBox and the border should be collapsed(I got this thing). And what i need is the BrowserHost should attain the full screen after the Border and UrlTextBox is collapsed. But for me it is not happening. Please see the below image. I want to make the BrowserHost in full screen when the user touches on the BrowserHost. I want the empty space to be filled with BrowserHost.

You need to specify BorderBrush and BorderThickness properties for the Border, like this
Update:
Also Set Grid.Row=”0″ to your stackpanel.
And then modify your cs code