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

  • Home
  • SEARCH
  • 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 7570557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:27:21+00:00 2026-05-30T15:27:21+00:00

Hi I have a silverlight MVVM application using MVVM light. When I open the

  • 0

Hi I have a silverlight MVVM application using MVVM light.
When I open the application a child window should popup and upon specifying the condition in the child window and clicking OK button the main window should display the details.

 public MainPage()
    {
        ChildPage cp = new ChildPage();
        cp.Show();
        InitializeComponent();
    }

upon hitting OK button on the child window this window should disappear and display a list of objects on the main window. In the View Model of the child window I have a RelayCommand OKCommand.

 private void WireCommands()
    {
        OKCommand = new RelayCommand(GetEmployees);
    }

    private void GetEmployees()
    {
        IEnumerable<Employees> employees;
                       employees = from employee in Employees where employee.Name == selectedEmployee.Name select employee;

        Employees= new ObservableCollection<Employee>(employees);
    }

The Employees has the required result. But I dont know how to close the chils window and move the result to the parent window. Thanks in advance.

  • 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-30T15:27:22+00:00Added an answer on May 30, 2026 at 3:27 pm

    You can use (in increasing order of decoupling):

    1. As you have a reference to the ChildPage in MainPage, you can access its properties.
    2. Use standard .NET events, where the event is on the child page, and the subscribing is done in the MainPage
    3. Use an event aggregator pattern. Several MVVM frameworks implement the event aggregator pattern.

    Using .NET Events

    ChildPage cp = new ChildPage();
    cp.NameReceived += NameReceived;
    cp.Show();
    
    private void NameRecieved(object sender, NameReceivedEventArgs eventArgs)
    {
      // retrieve employees using eventargs.Name
    }
    

    Using Event Aggregator from Caliburn.Micro

    public class MainPage : Screen, IHandle<NameReceivedMessage>
    {
      public MainPage(IEventAggregator eventAggregator)
      {
        eventAggregator.Subscribe(this);
      }
    
      public void Handle(NameReceivedMessage message)
      {
        // retrieve employees using message.Name which is the inputted name
      }
    }
    

    Here we are doing the employee retrieval in the MainPage, after receiving the name from the ChildPage. Alternatively, you could retrieve the employees in the ChildPage, and pass them in the event args/message.

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

Sidebar

Related Questions

I have a question on using MVVM within a Silverlight application I am developing.
I am using RIA services to serve entities to a MVVM-Light enabled Silverlight application.
We have application have been written in Silverlight using MVVM pattern. We need to
I have a silverlight bing map application. I am using the MVVM pattern with
we have developed an intranet application with Silverlight 4 using MVVM with PRISM. Up
I am using Silverlight 4 and MVVM pattern for my application. I have a
I have a Silverlight application architected using an MVVM approach. In my ViewModel it
I'm writing a Silverlight app using the MVVM pattern. I have a main view
I am creating a Silverlight 4 application with Entity Framework, RIA Services and MVVM-Light
I have an MVVM Silverlight 4 application that holds a list of modules (a

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.