wpf staticresource 是不允许向前引用(forward reference)的
不允许向前引用(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 staticresource 是不允许向前引用(forward reference)的的更多相关文章
- Java向前引用容易出错的地方
所谓向前引用,就是在定义类.接口.方法.变量之前使用它们,例如, class MyClass { void method() { System.out.println(myvar); } String ...
- java向前引用
根据看书和看得文章,引出了一个关于"向前引用"的问题: public class InstanceInitTest { static { // { a = 6; System.ou ...
- python自定义函数可以向前引用不用声明
#有些编程语言不够"聪明",向这类向前引用的方式会导致报错,但Python足够"醒目",这段代码是正确的! def next(): print('我在n ...
- How do I duplicate a resource reference in code behind in WPF?如何在WPF后台代码中中复制引用的资源?
原文 https://stackoverflow.com/questions/28240528/how-do-i-duplicate-a-resource-reference-in-code-behi ...
- 向前引用 ? float VS long ? 这些知识你懂吗?
thinking in java 读书笔记(感悟): 作者:淮左白衣 : 写于 2018年4月2日18:14:15 目录 基本数据类型 float 和 long 谁更大 System.out.prin ...
- Forward reference vs. forward declaration
Q:Im a bit confused. What is the difference between forward declaration and forward reference? Forwa ...
- 错误代码: 1247 Reference 'startTime' not supported (forward reference in item list)
1.错误描述 1 queries executed, 0 success, 1 errors, 0 warnings 查询:SELECT a.createUserId AS typeId, (SELE ...
- 方法引用(Method reference)和invokedynamic指令详细分析
方法引用(Method reference)和invokedynamic指令详细分析 invokedynamic是jvm指令集里面最复杂的一条.本文将详细分析invokedynamic指令是如何实现方 ...
- Java中的函数式编程(四)方法引用method reference
写在前面 我们已经知道,lambda表达式是一个匿名函数,可以用lambda表达式来实现一个函数式接口. 很自然的,我们会想到类的方法也是函数,本质上和lambda表达式是一样的,那是否也可以用类 ...
随机推荐
- Centos 6 安装 python2.7 和 pip
一.安装 python2.7 [root@crazy-acong ~]# cd /data/tools/ [root@crazy-acong tools]# yum groupinstall &quo ...
- Swift编程语言学习6—— 闭包
闭包是自包括的函数代码块,能够在代码中被传递和使用. Swift 中的闭包与 C 和 Objective-C 中的代码块(blocks)以及其它一些编程语言中的 lambdas 函数比較类似. 闭 ...
- ARDUINO W5100 WebServer测试
1.直接下载官方的enternet->WebServer代码 /* Web Server A simple web server that shows the value of the anal ...
- python基础15 ---面像对象的程序设计
面向对象的程序设计 一.面向对象的程序设计简介 1.面向对象程序设计的由来. 我们之前虽然学习过了面向过程的程序,它的核心是面向过程,一步一步的设计好了的流程,虽然极大的降低了程序的复杂度,但是一个设 ...
- Linux基础系列:常用命令(7)_正则表达式
一.环境边量 每个用户登录shell需要执行的四个文件 /etc/profile /home/egon/.bashrc_profile /home/egon/.bashrc /etc/bashrc 非 ...
- Shiro:学习笔记(1)——身份验证
Shiro——学习笔记(1) 1.核心概念 1.Shiro不会自己去维护用户.维护权限:这些需要我们自己去设计/提供:然后通过相应的接口注入给Shiro.2.应用代码直接交互的对象是Subject,也 ...
- ubuntu14.04 安装pip vitualenv flask
安装pip: $ apt-get install python-pip$ pip -V #查看版本 确认安装成功 安装完pip后,会发现下载的速度特别慢.按如下修改: $ vim ~/.pip/pip ...
- flex DataGroup
示例1: <?xml version="1.0" encoding="utf-8"?> <s:DataGroup xmlns:fx=" ...
- spring-boot3
更多的配置: # =================================================================== # COMMON SPRING BOOT PR ...
- 第一篇、javascript变量和循环
一.代码存放位置 理论上放在body和head中都可以,但是推荐放在body代码块底部,因为Html代码是从上到下执行,如果Head中的js代码耗时严重,就会导致用户长时间无法看到页面,如果放置在bo ...