不允许向前引用(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)的的更多相关文章

  1. Java向前引用容易出错的地方

    所谓向前引用,就是在定义类.接口.方法.变量之前使用它们,例如, class MyClass { void method() { System.out.println(myvar); } String ...

  2. java向前引用

    根据看书和看得文章,引出了一个关于"向前引用"的问题: public class InstanceInitTest { static { // { a = 6; System.ou ...

  3. python自定义函数可以向前引用不用声明

    #有些编程语言不够"聪明",向这类向前引用的方式会导致报错,但Python足够"醒目",这段代码是正确的! def next():     print('我在n ...

  4. 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 ...

  5. 向前引用 ? float VS long ? 这些知识你懂吗?

    thinking in java 读书笔记(感悟): 作者:淮左白衣 : 写于 2018年4月2日18:14:15 目录 基本数据类型 float 和 long 谁更大 System.out.prin ...

  6. Forward reference vs. forward declaration

    Q:Im a bit confused. What is the difference between forward declaration and forward reference? Forwa ...

  7. 错误代码: 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 ...

  8. 方法引用(Method reference)和invokedynamic指令详细分析

    方法引用(Method reference)和invokedynamic指令详细分析 invokedynamic是jvm指令集里面最复杂的一条.本文将详细分析invokedynamic指令是如何实现方 ...

  9. Java中的函数式编程(四)方法引用method reference

    写在前面 我们已经知道,lambda表达式是一个匿名函数,可以用lambda表达式来实现一个函数式接口.   很自然的,我们会想到类的方法也是函数,本质上和lambda表达式是一样的,那是否也可以用类 ...

随机推荐

  1. Webpack探索【7】--- sourceMap、自动构建刷新功能详解

    本文主要讲sourceMap.自动构建刷新功能.

  2. 我的Android进阶之旅------>如何将Activity变为半透明的对话框?

    我的Android进阶之旅------>如何将Activity变为半透明的对话框?可以从两个方面来考虑:对话框和半透明. 在定义Activity时指定Theme.Dialog主题就可以将Acti ...

  3. [原创]java WEB学习笔记37:EL表达式(简介,运算符,自动类型转换,保留字,隐含对象)

    1.EL 简介 1)EL 全名为 Expression  Language,它原本是 JSTL  1.0 为方便存取数据所自定义的语言 2)语法:EL 语法很简单,它最大的特点就是使用上很方便:${s ...

  4. 《机器学习实战》学习笔记第十一章 —— Apriori算法

    主要内容: 一.关联分析 二.Apriori原理 三.使用Apriori算法生成频繁项集 四.从频繁项集中生成关联规则 一.关联分析 1.关联分析是一种在大规模数据集中寻找有趣关系的任务.这些关系可以 ...

  5. POJ2253 frogger 最短路 floyd

    #include<iostream>#include<algorithm>#include<stdio.h>#include<string.h>#inc ...

  6. linux基本使用

    (待完善,想到哪就写到哪,目前内容大幅度参考中文man手册) 最重要的命令(man) 在 Linux 下遇到问题,最重要的是要自己寻求帮助, google是个好东西 man 是 Linux 的帮助手册 ...

  7. delphi各个版本编译开关值

    delphi各个版本编译开关值 {$IFDEF VER80}  - Delphi 1{$IFDEF VER90}  - Delphi 2{$IFDEF VER100} - Delphi 3{$IFDE ...

  8. Delphi UniDAC 通过http协议连接数据库的设置

    Connection through HTTP tunnel(using http protocol) Sometimes client machines are shielded by a fire ...

  9. EntityFramework 学习 一 Querying with EDM 从EDM查询

    前面我们已经创建EDM.DbContext和实体类,接下来我们学习不同的查询实体方法,转变为数据库的SQL查询 Entity Framework支持3种查询方式:1)LINQ to Entities ...

  10. java套接字实现接口访问

    是学校博客上的:http://blog.csdn.net/z69183787/article/details/17580325