在UWP的XAML中使用原始类型
问题:
I'm trying to access the system namespace for StaticResource variables in XAML on UWP. Here's (mostly) what I'm using: <Page
x:Class="App.UWP.Views.Step6"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:System="using:System"
mc:Ignorable="d"> <Page.Resources>
<System:Double x:Key="ItemNameWidth"></System:Double>
</Page.Resources> <TextBlock FontSize="" Width="{StaticResource ItemNameWidth}">foo</TextBlock>
</page>
Even though the <System:Double ...> shows in IntelliSense as valid, I'm getting the following runtime error: An exception of type 'Windows.UI.Xaml.Markup.XamlParseException' occurred in mscorlib.ni.dll but was not handled in user code WinRT information: Cannot deserialize XBF metadata type list as 'Double' was not found in namespace 'System'. [Line: Position: ]
I'm open to other ways of declaring a double if this method will not work.
解决方案:
Turns out it's in the default x: namespace. <Page
x:Class="App.UWP.Views.Step6"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:System="using:System"
mc:Ignorable="d"> <Page.Resources>
<x:Double x:Key="ItemNameWidth"></x:Double>
</Page.Resources> <TextBlock FontSize="" Width="{StaticResource ItemNameWidth}">foo</TextBlock>
</page>
在UWP的XAML中使用原始类型的更多相关文章
- Java中的原始类型(Primitive Types)与引用类型(Reference Values)
Java虚拟机可以处理的类型有两种,一种是原始类型(Primitive Types),一种是引用类型(Reference Types). 与之对应,也存在有原始值(Primitive Values)和 ...
- java 中的原始类型与原始封装类型
Java 提供两种不同的类型:引用类型和原始类型(或内置类型).比如:Int是java的原始数据类型,Integer是java为int提供的封装类.Java为每个原始类型提供了封装类,常见的原始与 ...
- JS中的原始类型和判断方法
ECMAScript 中定义了 7 种原始类型: Boolean String Number Null Undefined Symbol(新定义) BigInt(新定义) 注意: 原始类型不包含 Ob ...
- UWP 在Xaml中使用cu和fcu资源
之前一直不知道这个,最近看微软的WTS项目更新,在Xaml中定义了 xmlns:fcu ="http://schemas.microsoft.com/winfx/2006/xaml/pres ...
- Effective Java 第三版——26. 不要使用原始类型
Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...
- 205K+程序员关注过的问题:为什么不应该使用Java的原始类型?
在逛 Stack Overflow 的时候,发现了一些访问量像熊耳山一样高的问题,比如说这个:为什么不应该使用Java的原始类型?访问量足足有 205K+,这不得了啊!说明有很多很多的程序员被这个问题 ...
- 【广州.NET社区推荐】【译】Visual Studio 2019 中 WPF & UWP 的 XAML 开发工具新特性
原文 | Dmitry 翻译 | 郑子铭 自Visual Studio 2019推出以来,我们为使用WPF或UWP桌面应用程序的XAML开发人员发布了许多新功能.在本周的 Visual Studio ...
- 【译】Visual Studio 2019 中 WPF & UWP 的 XAML 开发工具新特性
原文 | Dmitry 翻译 | 郑子铭 自Visual Studio 2019推出以来,我们为使用WPF或UWP桌面应用程序的XAML开发人员发布了许多新功能.在本周的 Visual Studio ...
- [UWP]xaml中自定义附加属性使用方法的注意项
---恢复内容开始--- 随笔小记,欢迎指正 在UWP平台上做WVVM的时候,想针对ListBox的SelectionChanged事件定义一个自定义的命令,于是使用自定义附加属性的方式.可是最后自定 ...
随机推荐
- html5中input的type类型有哪些(总结)
html5中input的type类型有哪些(总结) 一.总结 一句话总结:时间.颜色.(邮件.电话.url).(数字.数字范围).搜索search 二.html5中input的type类型 值 描述 ...
- ets学习
http://diaocow.iteye.com/blog/1768647 http://www.cnblogs.com/me-sa/archive/2011/08/11/erlang0007.htm ...
- DDoS ATTACK PROCESSING APPARATUS AND METHOD IN OPENFLOW SWITCH
An OpenFlow switch in an OpenFlow environment includes an attack determination module to collect sta ...
- MAC 安装下载好的.gz包(不像.dmg直接双击就行了)
下载之后解压,然后在terminal里敲命令吧: 复制文件:蓝色部分为你解压文件的路径,直接拖到这里就行了$ sudo mv mysql-5.1.45-osx10.6-x86_64文件路径 /usr/ ...
- Thermal management in a gaming machine
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to wager gaming ...
- Video processing systems and methods
BACKGROUND The present invention relates to video processing systems. Advances in imaging technology ...
- 使用UISegementControl实现简易Tomcat程序
// // TomViewController.m #import "TomViewController.h" #import <AVFoundation/AVFoundat ...
- 十分钟了解 spring cloud
1 为什么需要服务发现 简单来说,服务化的核心就是将传统的一站式应用根据业务拆分成一个一个的服务,而微服务在这个基础上要更彻底地去耦合(不再共享DB.KV,去掉重量级ESB),并且强调DevOps和快 ...
- SQLite 适用场景
SQLite最佳试用场合 网站 作为数据库引擎SQLite适用于中小规模流量的网站(也就是说, 99.9%的网站). SQLite可以处理多少网站流量在于网站的数据库有多大的压力. 通常来说, 如果一 ...
- 数学类网站、代码(Matlab & Python & R)
0. math & code COME ON CODE ON | A blog about programming and more programming. 1. 中文 统计学Computa ...