Let me start by saying that I code in VB and not C#. I am still learning C# and actually write some classes in C# but the majority of my code is in VB, so any examples would be better supplied in VB. I am also new to developing with Silverlight and WP7. With that being said here is my dilemma:
I am trying to use the jump list 100% within code. This is because I am dynamically creating PivotItems depending on different criteria and these new PivotItems have the RadJumpList on them. I am able to create the list and display a basic list (no group descriptors) with no problem.
My issue is with using descriptors (Group or Sort).
I have information I want to display for like this example:
(Servers are unique but services could be the same across servers - hence the need for grouping)
Server 1
Service 1
Service 2
Server 2
Service 3
Service 4
Server 3
Service 5
Service 6
The list of servers & services are brought in by a WCF object List(Of T) :
'irreverent fields removed for simplicity
Function
Dim
svcList
As
List(Of aService) = e.Result
End
Function
Public
Structure
aService
Public
Server
As
String
Public
Service
As
String
End
Structure
The WCF source content can be visualized like this:
Dim
svcList
As
New
List(Of aService)
svcList.Add(
New
aService
With
{.Service =
"service 1"
, .Server =
"Server 1"
})
svcList.Add(
New
aService
With
{.Service =
"service 2"
, .Server =
"Server 1"
})
svcList.Add(
New
aService
With
{.Service =
"service 3"
, .Server =
"Server 2"
})
svcList.Add(
New
aService
With
{.Service =
"service 4"
, .Server =
"Server 2"
})
svcList.Add(
New
aService
With
{.Service =
"service 5"
, .Server =
"Server 3"
})
svcList.Add(
New
aService
With
{.Service =
"service 6"
, .Server =
"Server 3"
})
I can create the basic ItemsSource like this (in my testing ):
Dim
radJumpList
As
New
RadJumpList
Dim
sList
As
New
List(Of
String
)
For
Each
svc
As
aService
In
svcList
sList.Add(svc.Service)
Next
radJumpList.ItemsSource = sList
This is the extent of how far I have been trying to get things working. I cannot figure out how to use the GenericGroupDescriptor or GenericSortDescriptor to properly group Servers/Services & sort properly. (Actually have not even got to sort yet as I can't group properly yet). I would like to sort the entier list by Server then Services for each server.
I think I need to do something like this but it errors and I cannot figure out the proper way.
Dim
groupByServer
As
New
GenericGroupDescriptor(Of aService,
String
)(
Function
(s) s.Server)
radJumpList.GroupDescriptors.Add(groupByServer)
I'm looks for help on how to get past this road block. Thanks.