【发布时间】:2014-05-27 07:00:31
【问题描述】:
我使用 c# 绑定了来自 web 服务的值,我的 xaml 代码如下所示
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<StackPanel>
<ListBox x:Name="PhoneList" Height="532" Background="{x:Null}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Height="100" Margin="5" Stretch="Fill" Width="100" Source="{Binding blogImage}"></Image>
<Grid x:Name="ContentPanel" Margin="20,0,0,0" Width="300" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock TextWrapping="Wrap" LineHeight=" 24" MaxHeight=" 48"LineStackingStrategy="BlockLineHeight" Grid.Row="0" Foreground="Black" FontStyle="Normal" Text="{Binding blogTitle }" Margin="0,0,0,0"/>
<TextBlock Grid.Row="2" VerticalAlignment="Top" TextWrapping="Wrap" Margin="0,3,0,0" Foreground="BlueViolet" FontStyle="Italic" Text="{Binding blogPostedon }" />
</Grid>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</StackPanel>
</Grid>
如何将超链接添加到整个堆栈面板并且我的超链接值在数据绑定中
【问题讨论】:
-
您想为 StackPanel 或 TextBlock 添加?你的问题标题是 TextBlock
-
将所需的 StackPanel 或 TextBlock 包裹在“HyperlinkButton.Content”中
-
@sanjeetharan:对不起,我只需要编辑堆栈面板...
-
@bit 标签在环绕堆栈面板时不被接受
-
在我的回答中查看示例
标签: c# xaml windows-phone-8 windows-phone-8.1