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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:12:22+00:00 2026-06-16T08:12:22+00:00

I have problem that i just cant figure out right now. I am trying

  • 0

I have problem that i just cant figure out right now.
I am trying to develop a Windows-8 style app and im stuck implementing this functionality.

I have a MainWindow which contains a ListBox and a Button (lets say addButton).

When i click the button i navigate to a new page, lets say AddCustomerPage with this.Frame.Navigate(typeof (AddCustomerPage));

AddCustomerPage has 1 textBox and 1 button (lets say doneButton. When i click the button i want the string in the textBox to be added to the ListBox on the previous page.

This is my current functionality:
1. MainWindow is created.

  1. Click addButton

  2. AddCustomer page is created. MainWindow is destroyed(problem).

  3. Click doneButton

  4. A MainWindow object is created with a ListBox with 1 item.

  5. Repeat the add process, i always get a MainWindow with a ListBox with 1 item.

Thanks for the help. Here is the code:

public sealed partial class MainPage : Page
{
    public MainPage()
    {
        this.InitializeComponent();

        this.brainPageController = new PageController();

        // add items from the List<String> to the listBox
        listGoals.ItemsSource = brainPageController.GetListGoals();
    }

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        var parameter = e.Parameter as String;
        // a simple controller that adds a string to a List<string>
        brainPageController.AddGoal(parameter);
    }

    private void addButton_Click(object sender, RoutedEventArgs e)
    {
        this.Frame.Navigate(typeof (GoalsInfo));
    }

    // VARIABLES DECLARATION
    private PageController brainPageController;
}

public sealed partial class GoalsInfo : WinGoalsWIP.Common.LayoutAwarePage
{
    public GoalsInfo()
    {
        this.InitializeComponent();
        this.brainPageController = new PageController();
    }

    protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
    {
    }
    protected override void SaveState(Dictionary<String, Object> pageState)
    {
    }

    private void Button_Click_1(object sender, RoutedEventArgs e)
    {
        brainPageController.AddGoal(nameTextBox.Text);

        this.Frame.Navigate(typeof(MainPage), nameTextBox.Text);
    }
    // VARIABLES DECLARATION
    PageController brainPageController;
}
  • 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-06-16T08:12:23+00:00Added an answer on June 16, 2026 at 8:12 am

    Try this i hope it helps

    Quickstart: Navigating between pages

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

Sidebar

Related Questions

I have a problem here that i can't seem to figure out, till now
I have a dynamic list code that works just fine. My only problem now
I've building a app right now that I'm trying to keep properly decoupled from
I am having a problem that just started happening in OS 3.1. I have
I have a problem, i have a query that just simply displays the user
I have a viewController that autorotates just fine, The problem is that is I
I've just installed VS2008 and have run into a problem that I'm sure can
I have a problem that I'm working on for quite some time now. I
I have been trying to figure out a question on a recent assignment for
I have some problems with Javascript. In fact, I'm just newbie in that script

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.