wpf staticresource 是不允许向前引用(forward reference)的
2016-01-13 12:06
447 查看
不允许向前引用(forward reference)在C/C++中中很常见,即在语法上,未定义变量、类之前,不能使用。
没想到wpf中的wpf staticresource也遵循这种规则。资源字典中,进行引用时,要主要了。
详见MSDN:https://msdn.microsoft.com/en-gb/library/cc189045(v=vs.95).aspx
Important Note:
A StaticResource must not attempt to make a forward reference to a resource that is defined lexically further within the XAML file. Attempting to do so is not supported, and even if such a reference does not fail, attempting the forward reference incurs a load-time performance penalty when the internal hash tables representing a ResourceDictionary are searched. For best results, adjust the composition of your resource dictionaries such that forward references can be avoided.
没想到wpf中的wpf staticresource也遵循这种规则。资源字典中,进行引用时,要主要了。
详见MSDN:https://msdn.microsoft.com/en-gb/library/cc189045(v=vs.95).aspx
Important Note:
A StaticResource must not attempt to make a forward reference to a resource that is defined lexically further within the XAML file. Attempting to do so is not supported, and even if such a reference does not fail, attempting the forward reference incurs a load-time performance penalty when the internal hash tables representing a ResourceDictionary are searched. For best results, adjust the composition of your resource dictionaries such that forward references can be avoided.
相关文章推荐
- nodejs关于session和cookie的问题
- jQuery WeUI v0.1.0 发布了 - 微信公众账号开发者的福音
- javascript笔记——jqGrid再次封装
- js 书写规范
- 加载本地html,js, css文 件
- hdu1569find the safest road(floyd变形求最大安全值)
- Css
- 【HTML打卡】0113 div布局,css控制
- 使用CDH5.3.0中Hadoop安装包进行伪分布模式安装
- angularjs 利用filter进行表单查询及分页查询
- SSH框架jsp迭代实体类,并获取关联对象的属性
- js倒计时
- 用bootstrap写弹窗,页面抖动问题
- js中数组的一些操作
- Javascript判断对象和字符串为空的优雅写法
- 数据导入
- CSS 垂直居中问题总结
- 纯CSS3实现自定义涂鸦风格的边框
- javascript 解析ajax返回的xml和json格式的数据
- 【数组】Game of Life