出于调试目的,我想设置BitmapImage
的{{1}}属性。不幸的是它没有退出。设置断点时有没有办法识别特定的Name
?在Winforms中,所有控件都具有Name
属性,即使它们没有,我们也可以使用Tag
属性。另一方面,对于BitmapImage
,我找不到任何可比的东西。
澄清:我需要定义BitmapImage
本身的内容,而不是指向它的变量,所以如果我有BitmapImage
- 我可以检查{{1}这是bi2 = bi1
。
答案 0 :(得分:0)
您可以使用x:Name
定义XAML中任何对象的名称。然后,您可以将其用于调试目的。
<Image>
<Image.Source>
<BitmapImage x:Name="MyBitmapImage"/>
</Image.Source>
</Image>