App.CurrentScreen — missing?

The documention refers to a property of the MobileApplication instance, CurrentScreen, but it’s not accessible:

Dim v As Variant = App.CurrentScreen

The code above yields a compile error. Perhaps there’s a new way to get the current screen?

If you type App.Current, what options do you have in autocomplete?

Only App.CurrentLayout

And drilling down to the that object’s properties doesn’t seem to point to the current screen.

Let me try typecasting it…

Dim s As PTEditorScreen = PTEditorScreen(App.CurrentLayout.Content)

Yes, this appears to be the way.

Feedback for the missing property:

It’s not missing. Layouts were called Screens previously. The bug is the documentation. Remember that current layout could also be a split view on an iPad.

1 Like