Hello,
let me first explain the difference between Owner and parentthis. There are two possibilities to create an object (an instance of a class):
Option 1: dynamically by using the new operator. The resulting object exists detached from other objects. In this case parentthis is null.
Option2: you embedd the object inside another class. The object will be nested inside this class. At the runtime when you create an object of this class, all nested objects are also instantiated and all of them are a fixed part of the superior object. In this case parentthis of the nested obejct refers to its superior object.
In other words, when you have several objects nested at the design time one inside another, with parentthis the nested object can access its superior object. This aggregation is established at the design time and can be changed anymore. This is valid for all kinds of objects (not necesarily GUI component). Accordingly a Timer object embedded within a class component will refer with its own parentthis to this component.
Owner, in turn, establishes a relation between two GUI component (it is available in objects acting as GUI component only). The both components have not necessarily be embedded one inside another. Unlike parentthis the relation can also change at the runtime. To establish the relation you use the method Add() to disolve it you use Remove().
Now let me address your actual problem. You create dynamically (Option 1 above) an instance of Application::ScreenMain and then you present it within the Container component. This is correct approach. During initialization time of the ScreenMain you would like to access the Application component (root object). This fails. The reason is: at this time, the just created instance of ScreenMain is not part of the view tree. It does not know the root object. Calling its GetRoot() returns null.
Solution: in your ScreenMain move the initialization code to a separate method. Declare the parameters of the method with all the vallues you want to pass to the ScreenMain or with the class of your Application component. In this manner the ScreenMain can perform its initialization. Call the method explicitly just in the moment when you create the instance of the ScreenMain class. For example:
var Application::ScreenMain ScreenMain = new Application::ScreenMain;
ScreenMain.Initialize( value1, value2, value3, ..., GetRoot());
Container.PresentDialog(ScreenMain,null, null, null, null, null, null, null, null, false );
Instead the method Initialize() you can also implement in ScreenMain diverse properties to setup this component.
Does it help you?
Best regards
Paul Banach