Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Panorama content not loaded on Load event

$
0
0

I have a problem, I am trying to create a event that respositions and resiszes the groups inside a panorama, but the problem is that the content of the panorama content is not loaded on Load event.

Example code: (DemoAppsHub)

Private Sub PrepareHeader()
    Dim headerLayout As StackLayoutElement = New StackLayoutElement()
    headerLayout.Orientation = Orientation.Horizontal
    headerLayout.Margin = New System.Windows.Forms.Padding(0, 35, 0, 0)
    headerLayout.NotifyParentOnMouseInput = True
    headerLayout.ShouldHandleMouseInput = False
    headerLayout.StretchHorizontally = False
 
    Dim TempRadButtonElement As RadButtonElement = New RadButtonElement() With {.StretchHorizontally = False}
    Me.backButton = New RadButtonElement() With {.StretchHorizontally = False}
    Me.backButton.Margin = New Padding(40, 0, 28, 0)
    AddHandler backButton.Click, AddressOf backButton_Click
    Me.backButton.Visibility = ElementVisibility.Hidden
    headerLayout.Children.Add(Me.backButton)
 
    Me.headerLabel = New LightVisualElement()
    Me.headerLabel.Text = "Emufrontend"
    Me.headerLabel.Font = New Font("Segoe UI Light", 42, GraphicsUnit.Point)
    Me.headerLabel.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias
    Me.headerLabel.ForeColor = Color.White
    Me.headerLabel.TextAlignment = ContentAlignment.MiddleLeft
    Me.headerLabel.MaxSize = New Size(630, 110)
    Me.headerLabel.NotifyParentOnMouseInput = True
    Me.headerLabel.ShouldHandleMouseInput = False
    Me.headerLabel.StretchHorizontally = False
 
    headerLayout.Children.Add(Me.headerLabel)
 
    Me.RadPanoramaMain.PanoramaElement.Children.Add(headerLayout)
 
    'MsgBox("Just here to delay things")
 
    For Each group As TileGroupElement In Me.RadPanoramaMain.Groups
        If group.Margin.Top < headerLayout.Size.Height Then
            group.Margin = New Padding(group.Margin.Left, headerLayout.Size.Height + 55, group.Margin.Right, group.Margin.Bottom)
        End If
    Next
 
 
End Sub
The problem is that when running this event on Mybase.Load, the headerLayout.Size.Height will be 0, unless you uncomment the Msgbox then it will detect the content height, why is this? Am I missing something basic in .Net or?

Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>