Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 308527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:39:31+00:00 2026-05-12T07:39:31+00:00

I have a listbox that I’m binding to a collection of objects. In the

  • 0

I have a listbox that I’m binding to a collection of objects.

In the code behind, I get a list of the jobs and bind it to the listbox items source:

List<JobEntity> jobList = new List<JobEntity>();
Job j = new Job();
jobList = j.LoadJobs(pageSize, pageIndex);
lbxJobs.ItemsSource = jobList;

In the xaml, I then try and access some of the properties of the job.

   <ListBox.ItemTemplate>
        <DataTemplate>
            <WrapPanel>
                <TextBlock Text="{Binding Path=Title}" Margin="5 0" />
                <TextBlock Text="{Binding Path=HiringCompany}" Margin="5 0" />
            </WrapPanel>
        </DataTemplate>
    </ListBox.ItemTemplate>

This works fine for a normal wpf application, but as an xbap app it throws an error that basically says it can’t get the value because Reflection Permissions were denied.

System.Windows.Data Error: 16 : Cannot
get ‘HiringCompany’ value (type
‘String’) from ” (type ‘JobEntity’).
BindingExpression:Path=HiringCompany;
DataItem=’JobEntity’
(HashCode=64844482); target element is
‘TextBlock’ (Name=”); target property
is ‘Text’ (type ‘String’)
TargetInvocationException:’System.Reflection.TargetInvocationException:
Property accessor ‘HiringCompany’ on
object ‘JobSearch.Classes.JobEntity’
threw the following
exception:’JobSearch.Classes.JobEntity.get_HiringCompany()’
—> System.MethodAccessException: JobSearch.Classes.JobEntity.get_HiringCompany()
—> System.Security.SecurityException:
Request for the permission of type
‘System.Security.Permissions.ReflectionPermission,
mscorlib, Version=2.0.0.0,
Culture=neutral,
PublicKeyToken=b77a5c561934e089’
failed

Has any one run into this before or found a workaround for this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:39:31+00:00Added an answer on May 12, 2026 at 7:39 am

    I just found the answer to my own question. I didn’t have my JobEntity class explicitly declared as “public”. Doing that resolved the issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListBox that is bound to a list of CustomerViewModel-objects, that each
I have listbox that displays information about list of objects: <ListBox Grid.Column=0 Height=152 Name=CustomersList
I have a listbox that is databound to a Collection of objects. The listbox
I have a listbox that is populated with a list of objects that has
I have a ListBox that is bound to a list of Persons. I want
I have a listbox that displays Shipment Items (custom class) that are formatted using
I have a ListBox with items that fill TextBox es. How do I identify
I have a data bound listbox that lists names of items, I am now
I have a Listbox that allows user to select multiple items. Normally user can
I have a ListBox that is a drop target of items from other sources.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.