洪燕华博客,黑暗圣经在线,icq中文版
1 <datagridtemplatecolumn header="binding"> 2 <datagridtemplatecolumn.celltemplate> 3 <datatemplate> 4 <image x:name="bindimg" height="30" width="30" source="{binding isbindable,converter={staticresource bindableconverter}}" verticalalignment="center" horizontalalignment="center"/> 5 </datatemplate> 6 </datagridtemplatecolumn.celltemplate> 7 </datagridtemplatecolumn>
1 public class bindableconverter : ivalueconverter 2 { 3 public object convert(object value, type targettype, object parameter, cultureinfo culture) 4 { 5 bool isbind; 6 if(value==null||string.isnullorwhitespace(value.tostring())) 7 { 8 return "../../resource/images/unbinded.jpg"; 9 } 10 if (boolean.tryparse(value.tostring(), out isbind)) 11 { 12 if (isbind) 13 { 14 return "../../resource/images/binded.jpg"; 15 } 16 else 17 { 18 return "../../resource/images/unbinded.jpg"; 19 } 20 } 21 return null; 22 } 23 24 public object convertback(object value, type targettype, object parameter, cultureinfo culture) 25 { 26 throw new notimplementedexception(); 27 } 28 }
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论