开发者

more Abbreviated XAML

Can you more abbretviate following code...

<Button.Tag>
    <BitmapImage UriSource="/WpfApplication1;component/Images/ButtonIcons/Butt开发者_StackOverflow社区onIcon_Sound.png"/>
</Button.Tag>

in one line?


You can define

"/WpfApplication1;component/Images/ButtonIcons/ButtonIcon_Sound.png"

as a StaticResource, then you would have something like,

<BitmapImage UriSource="{StaticResource SoundIcon}"/>

Also put this resource in a shared ResourceDictionary then you don't need to define it twice.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜