我想使用属性获取图像源在WPF中的图像控件中进行属性绑定 [英] i want to property binding in image control in WPF using property get source of image

查看:69
本文介绍了我想使用属性获取图像源在WPF中的图像控件中进行属性绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< image source = {Binding ImageProperty}  />

公共字符串ImageProperty

{

  得到{return @" D:\ ProjectDemo \ Image \ imgsport.png"}}

}

我想此返回值动态调用.请勿使用本地驱动器地址,例如:   D:\ ProjectDemo \ .....

我想将Uri源用于动态返回图像的值.

谢谢

解决方案

为ImageProperty添加设置值:

公共字符串ImageProperty
        {
            得到;
            放;
        }



<image source={Binding ImageProperty}  />

public string ImageProperty

{

   get { return @"D:\ProjectDemo\Image\imgsport.png"}

I want to  this return valur dynamicly call . Not use locat drive address like:    D:\ProjectDemo\.....

I want to Uri source used for dynamicly return valu of  image.

Thanks,

解决方案

Add set values for ImageProperty:

 public string ImageProperty
        {
            get;
            set;
        }



这篇关于我想使用属性获取图像源在WPF中的图像控件中进行属性绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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