Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("1")
NavControl.ShowPage(Page1)
SetImageItems(SegmentedControl1, Array (LoadBitmap(File.DirAssets, "image1.png"), _
LoadBitmap(File.DirAssets, "image2.png")))
End Sub
Sub SegmentedControl1_IndexChanged (Index As Int)
Log(Index)
End Sub
Sub SetImageItems(sc As SegmentedControl, Images As List)
Dim no As NativeObject = sc
no.RunMethod("removeAllSegments", Null)
Dim index As Int = 0
For Each bmp As Bitmap In Images
no.RunMethod("insertSegmentWithImage:atIndex:animated:", _
Array(bmp, index, False))
index = index + 1
Next
End Sub