In a production app, there are many cases where the developer would like to know the navigation-window context he/she is currently in. For example, when going through a set of windows to select a configuration, the developer calls "openWindow(nextWindow)) to open the next window ("push it") into the current context.
Right now, developers either store a global reference, e.g.
or pass the navigation-window to each new window being created, e.g.
I am proposing a solution where the developer can reference the current navigation-window using the "navigationWindow" instance property. See the following test-case for an example:
While the developer could still just use the "nav" property, it will get more complex when using a multi-level application which scope changes during the navigation-flow. Ideally, once we move the navigation-window to the universal Ti.UI.NavigationWindow namespace, we could expose the same for Android (cc Joshua Quick) and Windows (cc Kota Iguchi).
Requirements of this API:
- Return existing references only, no copies
- Make the property read-only
- Only return a navigation-window if one exists, error else