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 3403264
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:14:23+00:00 2026-05-18T05:14:23+00:00

I’m building a SL4 app. I have two controls, a top search bar and

  • 0

I’m building a SL4 app. I have two controls, a top search bar and a bottom favorites bar, that I’d like to be present on every page. I’m not sure what the best way to do this is.

My current approach uses a nav frame as the root visual:

App.xaml.cs:

this.RootVisual = new NavFrame();

NevFrame.xaml:

<Grid x:Name="LayoutRoot" Background="White">
    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition />
        <RowDefinition />
    </Grid.RowDefinitions>

    <my:TopSearchBar x:Name="topSearchBar" Grid.Row="0"/>

    <navigation:Frame x:Name="navigationFrame" Source="/HomePage.xaml" Grid.Row="1"/>

    <my:BottomFavoritesBar x:Name="bottomFavoritesBar" Grid.Row="2"/>

</Grid>

Then, I’d change pages within the Frame, leaving the persistent elements in place. Is this the correct approach, or is there some other preferred pattern?

However, if I do this, I’m not sure how to let the TopSearchBar and BottomFavoritesBar user controls do navigation. (In general, I’m not sure how to do navigation directly from a UserControl.)

When TopSearchBar was a member of each page, I’d have this code on each page’s code-behind:

topSearchBar.ParentPage = this;

TopSearchBar could then use this reference to do navigation:

ParentPage.NavigationService.Navigate(new Uri("/SearchPage.xaml?q=" + searchBox.Text, UriKind.Relative));

Is there a better way to do this? It feels somewhat awkward. If navigation requires a reference to a page, how can I pass that reference from NavFrame?

  • 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-18T05:14:24+00:00Added an answer on May 18, 2026 at 5:14 am

    The appropriate approach is to add a dependency property to both the TopSearchBar and BottomFavoritesBar called “Navigator” (or whatever you prefer) that has the type INavigate.

    Your xaml would look like this:-

    <Grid x:Name="LayoutRoot" Background="White"> 
        <Grid.RowDefinitions> 
            <RowDefinition /> 
            <RowDefinition /> 
            <RowDefinition /> 
        </Grid.RowDefinitions> 
    
        <my:TopSearchBar x:Name="topSearchBar" Grid.Row="0" Navigator="{Binding ElementName=navigationFrame}"/> 
    
        <navigation:Frame x:Name="navigationFrame" Source="/HomePage.xaml" Grid.Row="1"/> 
    
        <my:BottomFavoritesBar x:Name="bottomFavoritesBar" Grid.Row="2" Navigator="{Binding ElementName=navigationFrame}" /> 
    
    </Grid>
    

    Now in your two Bar user controls navigation is simply:-

    Navigator.Navigate(new Uri("/SearchPage.xaml?q=" + searchBox.Text, UriKind.Relative)); 
    

    Edit

    To create the dependency properties add this to your TopSearchBar class:-

        public INavigate Navigator
        {
            get { return GetValue(NavigatorProperty) as INavigate; }
            set { SetValue(NavigatorProperty, value); }
        }
    
    
        public static readonly DependencyProperty NavigatorProperty =
            DependencyProperty.Register(
                "Navigator",
                typeof(INavigate),
                typeof(TopSearchBar),
                new PropertyMetadata(null));
    

    Duplicate this in your BottomFavoritesBar class but change the reference to TopSearchBar.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string

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.