Navigation:  Application Architecture > Putting it All Together > Designing an Application Component >

Overriding virtual methods

Previous pageReturn to chapter overviewNext page

In addition to the public members required to support the presentation model, let us override some of the virtual methods on the ApplicationComponent class:

 

    public override void Start()

    {

        base.Start();

    }

 

    public override void Stop()

    {

        base.Stop();

    }

 

The Start and Stop methods mark the beginning and end of the component's “live” phase. Start is called by the host when it is about to first show the component on the screen, and Stop is called by the host when it is about to remove the component from the screen.

In the case of this example, we don’t need to do anything in these methods, so we’ll just call the base class methods. (Note: always call the base class methods).