本文整理匯總了VB.NET中System.Windows.FrameworkElement.AddLogicalChild方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET FrameworkElement.AddLogicalChild方法的具體用法?VB.NET FrameworkElement.AddLogicalChild怎麽用?VB.NET FrameworkElement.AddLogicalChild使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。
在下文中一共展示了FrameworkElement.AddLogicalChild方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Child
<System.ComponentModel.DefaultValue(GetType(Object), Nothing)>
Public Overridable Property Child() As UIElement
Get
Return _child
End Get
Set(ByVal value As UIElement)
If _child IsNot value Then
'need to remove old element from logical tree
If _child IsNot Nothing Then
OnDetachChild(_child)
RemoveLogicalChild(_child)
End If
_vc.Clear()
If value IsNot Nothing Then
'add to visual
_vc.Add(value)
'add to logical
AddLogicalChild(value)
End If
'always add the overlay child back into the visual tree if its set
If _overlayVisual IsNot Nothing Then
_vc.Add(_overlayVisual)
End If
'cache the new child
_child = value
'notify derived types of the new child
If value IsNot Nothing Then
OnAttachChild(_child)
End If
InvalidateMeasure()
End If
End Set
End Property