Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you bind to a property on a reference object?
Message
From
15/07/2008 15:50:38
 
 
To
15/07/2008 14:51:54
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Miscellaneous
Thread ID:
01331472
Message ID:
01331487
Views:
8
>I have a Job object that includes a reference to a customer object that has data about the customer (from Linq-to-Sql call).
>
>So, how do I bind to the properties on the Customer reference that is within the Job item which is the DataContext for my ContentControl?
>
>For instance, the pseudo path to the phone number is like this:
>
>Job.Customer.phone
>
>so how do I poiont to that in the XAML?
>
>I tried (with no luck):
>
>
>             <TextBlock Text="{Binding Path=Customer.phone}" />
>
I struggled with that one too, ended up extending the entity class like this:
public partial class JobItem
  {
  public string  Phone { get { return Customer.phone; } }
  }
If you come up with a better solution let me know.<g>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform