I'm not sure that I understand what you're trying to do. Could you post a project?
A layout is not something loaded by a module, but by a panel (an activity is a panel) to fill it with views.
The source code is really big, let me see if i can explain better:
Sub Activity_Create(FirstTime As Boolean)
Dim Pan(3) As Panel
Pan(0).Initialize("")
Pan(1).Initialize("")
Pan(2).Initialize("")
Pan(0).LoadLayout("tabletpedidos")
Pan(1).LoadLayout("tabletmain")
Pan(2).LoadLayout("tabletpesqitens")
This is the regular way of loading the layout on panels to show up.
However I want the same effect, but calling a class
AppManager.CreateSlidingPanel("tabletpedidos", ...)
AppManager.CreateSlidingPanel("tabletmain")
AppManager.CreateSlidingPanel("tabletpesqitens")
This class, AppManager, has a member CreateSlidingPanel, that:
Public Sub CreateSlindingPanel(LayOut As String, Title As String, Index As Int, Main As Boolean, CreateEvent As Boolean)
If Not(Container.IsInitialized) Then
Container.Initialize
End If
Dim Pan As Panel
Pan.Initialize("")
Pan.LoadLayout(LayOut)
Container.AddPageAt(Pan, Title, Index)
If Main Then
PagerMain = Index
End If
End Sub
That works wonderful, however all the events of the Layout loaded remain on AppManager Class. I want them to go to the main activity. I dont want to define in the code each event and create callsub for each, because this very same AppManager will be used for other apps with totally different layouts. I am trying to create classes that are helpers to create applications, leaving only what is really specific for each application to be implemented on the main activity. Understand the idea?
Many Thanks again!