我有一个数据驱动的中心区域,可以很好地填充图像。视图模型包含文本,我想将其显示为工具提示,但不太清楚如何实现。
这是重要的片段:
<HubSection x:Uid="MyHub" x:Name="MyHubSection" Width="311">
<HubSection.Header>
<TextBlock x:Uid="HubMSectionHeader"
Style="{StaticResource MainHubSectionHeaderStyle}" Text="Friends"/>
</HubSection.Header>
<DataTemplate>
<StackPanel>
<Button x:Name="InviteButton" Content="Send Invite" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="InviteButton_Click"/>
<StackPanel >
<Grid>
<GridView ItemsSource="{Binding Friends}" Background="{ThemeResource HubBackground}" x:Name="FriendGrid" >
<GridView.ItemTemplate >
<DataTemplate>
<Image Source="{Binding ProfilePhotoBitmap, Mode=TwoWay}" Height="100" Opacity="1" Stretch="Uniform" Tapped="Friend_Tapped"/>
<ToolTipService.ToolTip>
<TextBlock Text="{Binding FullName}"/>
</ToolTipService.ToolTip>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
</Grid>
</StackPanel>
</StackPanel>
</DataTemplate>
</HubSection>