Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you bind to a property on a reference object?
Message
De
15/07/2008 15:50:38
 
 
À
15/07/2008 14:51:54
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Divers
Thread ID:
01331472
Message ID:
01331487
Vues:
7
>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>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform