wpf image source绑定和转换器的使用

在资源文件中定义转换器,把字符串转换为BitmapImage类型 

 
        
    
  

 实现INotifyPropertyChanged接口,程序运行过程中,绑定的图片url变化后,界面上的图片即时变化。

 private string _imageSource = null;
        public string ImgSource
        {
            get
            {
                return _imageSource;
            }
            set
            {
                if (value != _imageSource)
                {
                    _imageSource &

你可能感兴趣的:(WPF开发)