By name?

One thing I didn't understand, how or where is "dd" initialized?
I can't find any information.

dd refers to the DesignerUtils (DDD) class
Code:
Private dd As DDD

Then later in App_Start or Page_Create (B4J ...) it is initialised ,
Code:
dd.Initialize
   
'The designer script calls the DDD class. A new class instance will be created if needed.
'In this case we want to create it ourselves as we want to access it in our code.
xui.RegisterDesignerClass(dd)

the latest xCLV example shows everything required to get up to speed.
 
Last edited:
One thing I did notice in the example was the older method to change / access a views property ..
Code:
Dim lbl As B4XView = dd.GetViewByName(pnl, "Label1")
lbl.Text = "Clicked!"

whereas you are still able to access the property directly ...
Code:
dd.GetViewByName(pnl, "Label1").Text = "Clicked!"
 
One thing I did notice in the example was the older method to change / access a views property ..
Code:
Dim lbl As B4XView = dd.GetViewByName(pnl, "Label1")
lbl.Text = "Clicked!"

whereas you are still able to access the property directly ...
Code:
dd.GetViewByName(pnl, "Label1").Text = "Clicked!"
That is because GetViewByName returns a B4XView.
Also, you should still be able to use the "As" keyword (inline casting):
B4X:
dd.GetViewByName(pnl, "Panel1").As(Panel).Elevation = 6
 
Back
Top