开发者

Help with binding in WPF

开发者 https://www.devze.com 2023-01-17 21:39 出处:网络
<Image Source=\"sourceHere\" Stretch=\"Uniform\" Width=\"100\" Height=\"100\"> <Image.ToolTip>
<Image Source="sourceHere" Stretch="Uniform" Width="100" Height="100">
    <Image.ToolTip>
        <Image Source="{Binding thisImage.Source}" Stretch="Uniform" />
    </Image.ToolTip>
</Image>

the parent image is a 开发者_Go百科thumbnail of a bitmap, but I want the tooltip to show the image with 100% size.

How can I bind the image within the tooltip to the parent's source?


<Image x:Name="thisImage" Source="sourceHere" Stretch="Uniform" Width="100" Height="100">
    <Image.ToolTip>
        <Image Source="{Binding ElementName=thisImage, Path=Source}" Stretch="Uniform" />
    </Image.ToolTip>
</Image>

should do it

0

精彩评论

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