开发者

How to customize the TextBlock inside the LonglistSelector

开发者 https://www.devze.com 2023-03-31 16:55 出处:网络
<toolkit:LongListSelector> <toolkit:LongListSelector.ItemTemplate> <DataTemplate> <StackPanel Orientation=\"Horizontal\">
<toolkit:LongListSelector>
    <toolkit:LongListSelector.ItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Name}" FontSize="22" TextWrapping="Wrap" />
                <TextBlock Name="Info" FontSize="18" TextWrapping="Wrap" />
            </StackPanel>
        </DataTemplate>
    </toolkit:LongListSelector.ItemTemplate>
</toolkit:LongListSelector>

I have the above LongListSelector which selects the "Name"(Binded in the first Textblock )values from a list. I also wanted to additional text to it,for which i created one more Textblock below that. I cou开发者_StackOverflow社区ldn't add the text to the second TextBlock like(Info.Text="HI") because it is inside the LonglistSelector

How to give the values to the second Textblock??

Thanks


Do you mean Info is a property on the DataContext of the page and not on the current item where Name is?

If so, you can use a DataContextProxy to get to the data outside of the list item. If not, you'll have to be more clear on what you mean.

0

精彩评论

暂无评论...
验证码 换一张
取 消