本文整理匯總了VB.NET中System.Windows.Controls.GroupStyle.HeaderStringFormat屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET GroupStyle.HeaderStringFormat屬性的具體用法?VB.NET GroupStyle.HeaderStringFormat怎麽用?VB.NET GroupStyle.HeaderStringFormat使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Windows.Controls.GroupStyle
的用法示例。
在下文中一共展示了GroupStyle.HeaderStringFormat屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: New
' The converter to group the items.
Public Class GroupByPrice
Implements IValueConverter
Public Function Convert(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
If Not(TypeOf value Is Double) Then
Return Nothing
End If
Dim itemPrice As Double = CDbl(value)
If itemPrice < 100 Then
Return 100
End If
If itemPrice < 250 Then
Return 250
End If
If itemPrice < 500 Then
Return 500
End If
Return 1000
End Function
Public Function ConvertBack(ByVal value As Object, ByVal targetType As Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
Throw New NotImplementedException()
End Function
End Class
' The type of objects that are added to the ItemsControl.
Public Class PurchaseItem
Public Property Description() As String
Public Property Price() As Double
Public Property OfferExpires() As Date
Public Sub New()
End Sub
Public Sub New(ByVal desc As String, ByVal price As Double, ByVal endDate As Date)
Description = desc
Me.Price = price
OfferExpires = endDate
End Sub
Public Overrides Function ToString() As String
Return String.Format("{0}, {1:c}, {2:D}", Description, Price, OfferExpires)
End Function
End Class
' The source of the ItemsControl.
Public Class ItemsForSale
Inherits ObservableCollection(Of PurchaseItem)
Public Sub New()
Add((New PurchaseItem("Snowboard and bindings", 120, New Date(2009, 1, 1))))
Add((New PurchaseItem("Inside VB, second edition", 10, New Date(2009, 2, 2))))
Add((New PurchaseItem("Laptop - only 1 year old", 499.99, New Date(2009, 2, 28))))
Add((New PurchaseItem("Set of 6 chairs", 120, New Date(2009, 2, 28))))
Add((New PurchaseItem("My DVD Collection", 15, New Date(2009, 1, 1))))
Add((New PurchaseItem("TV Drama Series", 39.985, New Date(2009, 1, 1))))
Add((New PurchaseItem("Squash racket", 60, New Date(2009, 2, 28))))
End Sub
End Class