[英]WPF - How to set my image source bind to another text
這是我的代碼:
<Canvas Width="100" Height="120">
<Image Name="First_Image" Source="{'Tag of Second_Image'}" Canvas.ZIndex="2" Width="80" Height="80" Canvas.Top="0" Canvas.Left="10"/>
<Image Name="Second_Image" Uid="{Binding XPath=@Name}" Canvas.ZIndex="2" Width="80" Height="20" Canvas.Bottom="20" Canvas.Left="10"
MouseLeftButtonDown="TTX" Tag="/Images/Image.png" Style="{StaticResource Function}"/>
</Canvas>
我正在嘗試將我的第一個圖像源設置為Second_Image的Tag。 那怎么可能?
使用ElementName綁定:
<Image Source="{Binding Tag, ElementName=Second_Image}" .../>
<Image x:Name="Second_Image" Tag="/Images/Image.png" .../>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.