Binding the property to a control defined inside a listboxitem template

Posted by Malcolm on Stack Overflow See other posts from Stack Overflow or by Malcolm
Published on 2010-04-28T06:12:57Z Indexed on 2010/04/28 6:23 UTC
Read the original article Hit count: 363

Filed under:
|
|

I have a class called ledgerObject :

public class LedgerObject
{
    public ChargeLine ChargeLine{ get; set; }

    public DelegateCommand Click_hyperbnCommand{ get; private set; }

    public LedgerObject()
    {
        this.Click_hyperbnCommand = new DelegateCommand(click_btn);
    }

    private void click_btn(object args)
    {
    }
}

The chargeLine which is the property of this class is itself a class and has some properties in it.

So I am binding the datacontext of a listbox to an array of LedgerObject, and I want to bind the textblock control defined inside a listboxitem template to the property of a ChargeLine. Any idea or suggestion will help.

I have tried this but not working:

<TextBlock Margin="4 0 4 0" Grid.Column="3" Text="{Binding Path=ChargeLine.SimCode}" TextDecorations="Underline" Foreground="Red" />

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about c#