[WPF系列] 高级 调试

ImageBrush出现TypeConverter问题

‘Provide value on ‘System.Windows.Baml2006.TypeConverterMarkupExtension‘ threw an exception.‘ Line number ‘49‘ and line position ‘38‘

 

Assuming the image is:

  • Included in your project
  • It‘s in a folder named "Images"
  • The build action for the image is set to "Resource" (should be the default)

You can reference it like this:

<ImageBrush ImageSource=
   "pack://application:,,,/YourProjectName;component/Images/wood1_1000X1000.jpg";

 

This fixed the issue, I put the image in the project folder whithout including it in the project itself.

 

 

With与MaxWidth的区别

当你所要控制的对象,宽度或者高度值总是变化,而不是你想要指定的固定值,那么很有可能设置成了MaxHeight(MaxWidth)

[WPF系列] 高级 调试

上一篇:WINDOWS 7、windows xp下查看无线网络密码


下一篇:安装win7系统是提示:windows安装程序无法将windows配置为在此计算机的硬件上运行