Binding a text from a Class RRS feed

  • Question

  • Hi Guys Need Your Help please,

    I want to make a Binding Text from a class to a TextBlock.

    When i click on a ListItem will Appear this TextBlock Like next image but the Text cannot Appear what should i do ?

    Tuesday, April 1, 2014 12:59 PM


  • You'll have to add a DataTemplate to your xaml in your page's resources section:

    <DataTemplate x:Key="mytemplate">

    <TextBlock Text="{Binding Name}" Width="{Binding Width}" Height="{Binding Height}" />


    And then for your listbox, grid or whatever control you're binding to the ListItem collection, add

    ItemTemplate="{StaticResource mytemplate}"


    Darin R.

    Tuesday, April 1, 2014 4:51 PM