Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你能更缩写以下代码吗?
<Button.Tag> <BitmapImage UriSource="/WpfApplication1;component/Images/ButtonIcons/ButtonIcon_Sound.png"/> </Button.Tag>
在一条线上?
你可以定义
"/WpfApplication1;component/Images/ButtonIcons/ButtonIcon_Sound.png"
作为一个静态资源,那么你会有类似的东西,
<BitmapImage UriSource="{StaticResource SoundIcon}"/>
还将这个资源放在一个共享的 ResourceDictionary 中,然后你不需要定义它两次。