问题:
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中使用原始类型的更多相关文章

  1. Java中的原始类型(Primitive Types)与引用类型(Reference Values)

    Java虚拟机可以处理的类型有两种,一种是原始类型(Primitive Types),一种是引用类型(Reference Types). 与之对应,也存在有原始值(Primitive Values)和 ...

  2. java 中的原始类型与原始封装类型

    Java   提供两种不同的类型:引用类型和原始类型(或内置类型).比如:Int是java的原始数据类型,Integer是java为int提供的封装类.Java为每个原始类型提供了封装类,常见的原始与 ...

  3. JS中的原始类型和判断方法

    ECMAScript 中定义了 7 种原始类型: Boolean String Number Null Undefined Symbol(新定义) BigInt(新定义) 注意: 原始类型不包含 Ob ...

  4. UWP 在Xaml中使用cu和fcu资源

    之前一直不知道这个,最近看微软的WTS项目更新,在Xaml中定义了 xmlns:fcu ="http://schemas.microsoft.com/winfx/2006/xaml/pres ...

  5. Effective Java 第三版——26. 不要使用原始类型

    Tips <Effective Java, Third Edition>一书英文版已经出版,这本书的第二版想必很多人都读过,号称Java四大名著之一,不过第二版2009年出版,到现在已经将 ...

  6. 205K+程序员关注过的问题:为什么不应该使用Java的原始类型?

    在逛 Stack Overflow 的时候,发现了一些访问量像熊耳山一样高的问题,比如说这个:为什么不应该使用Java的原始类型?访问量足足有 205K+,这不得了啊!说明有很多很多的程序员被这个问题 ...

  7. 【广州.NET社区推荐】【译】Visual Studio 2019 中 WPF & UWP 的 XAML 开发工具新特性

    原文 | Dmitry 翻译 | 郑子铭 自Visual Studio 2019推出以来,我们为使用WPF或UWP桌面应用程序的XAML开发人员发布了许多新功能.在本周的 Visual Studio ...

  8. 【译】Visual Studio 2019 中 WPF & UWP 的 XAML 开发工具新特性

    原文 | Dmitry 翻译 | 郑子铭 自Visual Studio 2019推出以来,我们为使用WPF或UWP桌面应用程序的XAML开发人员发布了许多新功能.在本周的 Visual Studio ...

  9. [UWP]xaml中自定义附加属性使用方法的注意项

    ---恢复内容开始--- 随笔小记,欢迎指正 在UWP平台上做WVVM的时候,想针对ListBox的SelectionChanged事件定义一个自定义的命令,于是使用自定义附加属性的方式.可是最后自定 ...

随机推荐

  1. erlang局域网内节点通信——艰难四步曲

    http://blog.chinaunix.net/uid-22566367-id-382011.html 在Programming Erlang这本书中,在写到第十章中,主要实现的是不同节点之间的通 ...

  2. POJ 3714 Raid(平面近期点对)

    解题思路: 分治法求平面近期点对.点分成两部分,加个标记就好了. #include <iostream> #include <cstring> #include <cst ...

  3. lipo: can't open input file

    错误1: /Volumes/Mac OS/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u ...

  4. Max-Min Fairness带宽分配算法

    近期再写一个网络仿真器,里面參考了Max-MinFairness算法,这是一种比較理想.公平的带宽分配算法.其思路主要例如以下:首先是算法的准备,考察某一时刻的网络中全部的flow,因为每条flow都 ...

  5. 【BZOJ 1029】[JSOI2007]建筑抢修

    [题目链接]:http://www.lydsy.com/JudgeOnline/problem.php?id=1029 [题意] [题解] /* 按照T2升序排 顺序枚举每一个建筑; 如果当前建筑能够 ...

  6. cxf整合spring发布rest服务 httpclient访问服务

    1.创建maven web项目并添加依赖 pom.xml <properties> <webVersion>3.0</webVersion> <cxf.ver ...

  7. Swift下CoreData的使用

    我之前的随笔中有写过一些iOS持久化存储的方法,包含了sqlite.解归档.沙盒存放等等.这些方式中,能够大规模存储,并保持性能的只有使用sqlite了.而这里将记录下Cocoa自身继承的数据库的存储 ...

  8. 5.1 入门整合案例(SpringBoot+Spring-data-elasticsearch) ---- good

    本节讲解SpringBoot与Spring-data-elasticsearch整合的入门案例. 一.环境搭建 新建maven项目,名字随意 pom.xml <parent> <gr ...

  9. Android 平台下Cordova 调用Activity插件开发

    首先建立一个包名为package com.JiajiaCy.CallActivity; package com.JajaCy.CallActivity; import org.apache.cordo ...

  10. LR杂记 - Linux的系统监控工具vmstat详细说明

    一.前言 非常显然从名字中我们就能够知道vmstat是一个查看虚拟内存(Virtual Memory)使用状况的工具,可是如何通过vmstat来发现系统中的瓶颈呢?在回答这个问题前,还是让我们回想一下 ...