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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:10:56+00:00 2026-05-26T09:10:56+00:00

I expected that child View Models inheriting from Screen would participate in the Parent

  • 0

I expected that child View Models inheriting from Screen would participate in the Parent Screen’s life-cycle. However, it appears this is not the case. For example:

public class ParentViewModel : Screen
{
    public ChildViewModel Child { get; set; }

    public ParentViewModel(ChildViewModel childViewModel)
    {
        this.Child = childViewModel;
    }

    public override void OnInitialize() { // called - as expected }

    public override void OnActivate() { // called - as expected }

    public override void OnDeactivate() { // called - as expected }
}

public class ChildViewModel : Screen
{
    public override void OnInitialize() { // not called - why? }

    public override void OnActivate() { // not called - why? }

    public override void OnDeactivate() { // not called - why? }
}

Is it possible to have a child Screen participate in the parent Screen’s life-cycle?

  • 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-26T09:10:56+00:00Added an answer on May 26, 2026 at 9:10 am

    It seems this behaviour is not by default and the parent has to be told to ‘conduct’ child View Models using the ConductWith method, as follows:

    public class ParentViewModel : Screen
    {
        public ChildViewModel Child { get; set; }
    
        public ParentViewModel(ChildViewModel childViewModel)
        {
            this.Child = childViewModel;
    
            Child.ConductWith(this);
        }
    }
    

    This ensures the ChildViewModel will be initialized, activated and deactivated at the same time as the parent. The ActivateWith method can be used if you only need to initialize/activate the child.

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

Sidebar

Related Questions

I've a child view (SharedView) that's shared between two parent views so I add
I wrote a simple example that I expected would do it. The relevant code
I have a very simple HTML5 game that works as expected from a regular
Setup: I have parent view A. It has a child view B. B is
I have a Rails app implementing a game, so it's expected that a player
Is it expected behavior that two encodings can map to the same decoding? I'm
Getting red warning message that expected identifier for this statement CALayer = ImageView.layer; Using
I have a program that's expected to take as input a few options to
I wrote some code in VHDL that is expected to look at a rotory
I am working on a database that is expected to operate over multiple distributed

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.