Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Appli Resource
2 replies. Latest Post by sunil.n.cs on November 7, 2009.
(0)
sunil.n.cs
Member
16 points
66 Posts
11-06-2009 5:04 AM |
Hi,
At the starting of the application i am retrieving a list of data using web service and keeping it in appl resource as shown below..
Private Sub webser_fnRoleCompleted(ByVal sen As Object, ByVal e As ServiceReference1.fnRoleCompletedEventArgs) If IsNothing(e.Result) = False Then If (App.Current.Resources.Contains("Roles")) Then App.Current.Resources.Remove("Roles") End If App.Current.Resources.Add("Roles", e.Result) End If End Sub
so that i can access this in another page later as follows..
Dim roles = App.Current.Resources("Roles")
Which works fine, but the problem is i can see the data present in it only in debug mode, and i cant querry out the data in it, like
roles.Result.Item(0).UserID
Can any1 plz help me out here, how can i keep a list of data in application resource and later access it.
prujohn
Contributor
3579 points
704 Posts
11-06-2009 11:00 AM |
I'm not sure what Type your collection of roles is, but I think you need to cast to it when you do your assignment, like so:
Dim roles = App.Current.Resources("Roles") As MyRolesCollectionType
That way you'll be able to access the underlying properties of the Type.
11-07-2009 1:24 AM |
Ya thanks, i casted to its corresponding collection and it started working.