Skip to main content

Microsoft Silverlight

Answered Question Appli ResourceRSS Feed

(0)

sunil.n.cs
sunil.n.cs

Member

Member

16 points

66 Posts

Appli Resource

 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.

 

Thanks in advance

prujohn
prujohn

Contributor

Contributor

3579 points

704 Posts

Answered Question

Re: Appli Resource

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.

sunil.n.cs
sunil.n.cs

Member

Member

16 points

66 Posts

Re: Appli Resource

 Ya thanks, i casted to its corresponding collection and it started working.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities