Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7576179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:51:34+00:00 2026-05-30T16:51:34+00:00

I am wondering why the first time I try to load the informations with

  • 0

I am wondering why the first time I try to load the informations with a WebBrowser , the page is cropped, and the second time it’s displaying the informations well.

Or for example, the orientation is portrait, and when I turn to landscape and go back to portrait everything is displayed ..

This is the code I use .

private void Default_Loaded(object sender, RoutedEventArgs e)
    {
        //  Only need to reset web page when creating a new info page (coming from Info index or tombstoned app):
        if (_newPageInstance && (NavigationContext.QueryString.Count >= 1))
        {
            //  Set html page for web browser control based on park and page # passed in:
            if (_parkId.Length <= 0)
            {
                _parkId = App.MapModel.InfoParkId;  //  App.ViewModel.CurrentPark.ParkId might not be ready if tombstoned
                _parkPage = Convert.ToInt32(NavigationContext.QueryString.Values.First());
                SubTitle.Text = App.MapModel.InfoPageTitle; //  set title like "Legend" for this page
            }
            //  else - these 3 values were set during OnNavigatedTo when returning from tombstoning
            //
            Browser.Base = Constants.ParkInfoDirectory;    //  "ParkInfo" folder
            string s = string.Format("{0}/section_{1}.html", _parkId, _parkPage);    //  URL = "/ParkInfo/ti217/5" for page 5 of Rainier

            Browser.Navigate(new Uri(s, UriKind.Relative));

            //Browser.Navigate(new Uri(s, UriKind.Relative));
        }

        //var myHeight = this.ActualHeight;

        //Browser.Height = ((StackPanel)Browser.Parent).ActualHeight;

        this.Browser.UpdateLayout();

        this.ContentPanel.UpdateLayout();
    }

    // Executes when the user navigates to this page (or coming back from being tombstoned):
    protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        base.OnNavigatedTo(e);
        if (ParkMaps.App.ViewModel.CurrentPark != null)
        {
            //  Set title bar to use this park's name:
            PageTitle.Text = ParkMaps.App.ViewModel.CurrentPark.ParkNameUpper;
        }
        else PageTitle.Text = "Park Maps";
        // If the constructor has been called AND the PreservingPageState key is in the State dictionary,
        // then the UI state for this page should be restored:
        if (_newPageInstance && this.State.ContainsKey("PreservingPageState"))
        {
            //  Restore the state of the UI:
            try
            {
                _parkId = Utilities.TryGetValue<string>(State, "InfoParkId", "ti217");
                _parkPage = Utilities.TryGetValue<int>(State, "InfoDetailsParkPage", 0);
                SubTitle.Text = Utilities.TryGetValue<string>(State, "InfoDetailsSubtitle", "Park Info");
                //  NOTE: Browser not ready yet, so load web page in Default_Loaded above
            }
            catch { } //  Don't restore anything if had trouble above
        }
    }

And this is the XAML

    <StackPanel Orientation="Vertical"  Grid.Row="0">
        <StackPanel x:Name="TitlePanel" Margin="8,4,8,4" Orientation="Horizontal">
            <Image Source="{Binding LogoImageSource}" ManipulationCompleted="LogoBar_ManipulationCompleted" Width="208" Stretch="Uniform" HorizontalAlignment="Left" Margin="9,0,0,0"/>
            <TextBlock x:Name="PageTitle" Text="Park Maps" ManipulationCompleted="LogoBar_ManipulationCompleted" Width="250" Margin="-8,4,0,4" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="NoWrap" TextAlignment="Right" HorizontalAlignment="Stretch" />
        </StackPanel>
        <TextBlock x:Name="SubTitle" Text="Legend" Margin="9,6,9,9" Style="{StaticResource PhoneTextLargeStyle}" TextWrapping="Wrap" TextAlignment="Center" />
    </StackPanel>


    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" MinHeight="697" VerticalAlignment="Stretch" >



    </Grid>
</Grid>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:51:35+00:00Added an answer on May 30, 2026 at 4:51 pm

    If I’ve understood your question correctly, you’ll need to add:

     Stretch="Fill"
    

    to your XAML.

    If I haven’t understood your question, please rephrase the question as it isn’t obvious what you are trying to achieve.

    Thanks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm giving emacs a try for the first time and I was wondering if
first time use JTree. Just wondering is it possible to have more than one
I'm writing some user controls for the first time and I'm wondering if there's
It is my first time building an android app. Was wondering firstly, if there
I write a jQuery plugin the first time and I'm wondering if there is
was wondering if someone could help with this one. This is the first time
This is the first time that I'm upgrading the iphone sdk and am wondering
I saw this keyword for the first time and I was wondering if someone
It's my first time using SQL Server Profiler and I'm wondering how can i
I'm working with SQLAlchemy for the first time and was wondering...generally speaking is it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.