如何在返回ivalueconverter中绑定Staticresource [英] How can i bind a Staticresource in return ivalueconverter

查看:294
本文介绍了如何在返回ivalueconverter中绑定Staticresource的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

i在我的资源中有3个BitmapImage:

Hi everyone
i have 3 BitmapImage in my resources like this :

<BitmapImage x:Key="ImageSource_1" CreateOptions="IgnoreImageCache" CacheOption="OnLoad" UriSource="E:\Original Compiler\VIS Management\VIS Management\VIS Management\Images\BrowsersIcons\1.jpg"/>
		<BitmapImage x:Key="ImageSource_2" CreateOptions="IgnoreImageCache" CacheOption="OnLoad" UriSource="E:\Original Compiler\VIS Management\VIS Management\VIS Management\Images\BrowsersIcons\2.jpg"/>
		<BitmapImage x:Key="ImageSource_E3" CreateOptions="IgnoreImageCache" CacheOption="OnLoad" UriSource="E:\Original Compiler\VIS Management\VIS Management\VIS Management\Images\BrowsersIcons\3.jpg"/>





我有一个列表,它有一个字段我agename它给了我一个从1到3的数字

现在我想得到它的数字并将其转换为我的资源

但我该怎么办?

谢谢



I have a list and it has a field "Imagename" and it give to me a number from 1 to 3
Now i want get it number and convert it to my resources
but how can i do?
thank you

推荐答案

这可能会给你一个起点,



http://stackoverflow.com/questions/14259262/implementing-ivalueconverter-to-convert-字符串到图像 [ ^ ]



您将想要了解如何通过代码访问资源字典中的资源,因为这将是如何检索图像。
This might give you a starting point,

http://stackoverflow.com/questions/14259262/implementing-ivalueconverter-to-convert-string-to-image[^]

You will want to look at how to access resources within a resource dictionary through code as well because that will be how to retrieve the image.


这篇关于如何在返回ivalueconverter中绑定Staticresource的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆