Hello Riccardo,
your approach is correct. Please check following:
1. Ensure the SettingItem component has a method or property to configure its appearance. Possibly it is already the property TypeProperty or the method Initialize()? The idea here: the value of the property should correspond to the current content (switch, text, etc..) of the item. When the property is modified (or the method is invoked), the item should change its content (e.g. show switch and hide text).
2. In the OnLoadItem slot method assign to the above mentioned property (or invoke the Initialize() method) a value corresponding to the desired appearance of the item.
The SettingItem acts in such case as a universal 'item'. This is the unique approach in Embedded Wizard 11 or older. If you are working with Embedded Wizard 12, the list components are more flexible. Instead of using an 'universal' SettingItem, you can specify the item class for each item individually. For user who are working with version 12 (or newer) see the description of OnQueryItemClass in section: Specify the class of the items within the list.
Second Question, how do i interact with like a toggle button on the vertical list item? I assume on the on tap method? and after invalidate the view of the component to reload it?
It depends on your application case. In the simplest case you connect the item with a slot method during OnLoadItem. For example:
itemView.TypeProperty = ... /* value corresponding to switch (?) */
itemView.OnSwitchChanged = Slot_Method_To_Trigger_When_The_Switch_Is_Toggled;
More sophisticated is the approach to connect the switch with a data provider. The data-provider is a property existing usually in a global object. The switch remains in sync-with the value of this property. See also the section Connect the Toggle Button with a data provider explaining this approach in case of the Toggle Button widget. Here again, you establish the connection in the OnLoadItem when the item in question is initialized.
I hope it helps you further.
Best regards
Paul Banach