Private Shared ReadOnly ColumnWidthProperty As DependencyProperty = DependencyProperty.Register("ColumnWidth", GetType(Double), GetType(MainPage), New Windows.PropertyMetadata(AddressOf ColumnWidthChanged))
Private Property ColumnWidth() As Double
Get
Return DirectCast(GetValue(ColumnWidthProperty), Double)
End Get
Set(ByVal value As Double)
SetValue(ColumnWidthProperty, value)
End Set
End Property
Private Shared Sub ColumnWidthChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs) 'GridCol1 is a name of ColumnDefinition
DirectCast(d, MainPage).GridCol1.Width = New GridLength(DirectCast(e.NewValue, Double))
End Sub
星期四, 10月 28, 2010
[Silverlight][VB]將Grid的ColumnDefinition的width轉為DependencyProperty
ColumnWidth轉為DependencyProperty
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言