Binding Data Template element to property on sub-class

Posted by TerrorAustralis on Stack Overflow See other posts from Stack Overflow or by TerrorAustralis
Published on 2010-05-26T03:47:31Z Indexed on 2010/05/26 4:11 UTC
Read the original article Hit count: 180

Filed under:
|
|
|
|

Hi guys,

I have a class, for experiment sake call it foo() and another class, call it bar()
I have a data template for class foo() defined in my xaml, but one of foo()'s properties is a bar() object such that

foo()
{
    Public string Name {get; set;}
    Public int ID {get; set;}
    Public bar barProp {get; set;}
}

and

bar()
{
    Public string Description{get; set;}
}

I want my data template of foo to display the Description property of bar. I have tried the simple <textblock Text="{Binding Path=barProp.Description}" /> and variants to no avail

Seeking wisdom,
DJ

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf