嗨我目前正在建立一个闪存卡生产力的应用程序,有一个用户控制,我做了。在进行控制时,我意识到它太小了,无法在我的手机显示屏上很好地显示或很好地显示。于是我开始通过增加控件的宽度和高度来放大用户控件,并增加了用户控件中包含的所有控件的文本大小。只有当我尝试运行控件时,我才会得到此异常: SuperCards.exe中出现“Windows.UI.Xaml.Markup.XamlParseException”类型的异常,但未在用户代码中处理扩大控制
WinRT信息:无法从文本'%0'创建'%1' ”。 [Line:12 Position:48]
附加信息:无法找到与此错误代码关联的文本。
下面是用户控件的XAML代码:
<UserControl
x:Class="SuperCards.CardPackItemListView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SuperCards"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="125"
d:DesignWidth="400" >
<Border CornerRadius="2" BorderThickness="1" BorderBrush="White">
<Grid Background="White" Height="Auto" Width=" Auto">
<TextBlock x:Name="cardPackItemNameDisplay" HorizontalAlignment="Left" VerticalAlignment="Top" Width="Auto" Height="Auto" Text="(Sample) Periodic Table" Foreground="Gray" Margin="9,9,0,0" FontSize="30" />
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="9,30,9,9" Width="Auto" Height="9" Background="gray" >
<Rectangle HorizontalAlignment="Left" VerticalAlignment="Stretch" Fill="Red" Width="46"/>
</Grid>
<TextBlock HorizontalAlignment="Right" VerticalAlignment="Top" Text="36" Foreground="Gray" Margin="0,9,9,0" FontSize="30"/>
</Grid>
</Border>
这里视觉工作室通知该异常没有在用户控件的构造函数中初始化组件处理。
什么是你''的xmlns做? – 2014-12-04 16:04:07
我不知道是不是刚添加默认? – opeyemi 2014-12-04 16:10:27
对不起,我只是习惯看到更像=“clr-namespace:viewmodel”,但我特别寻找的是,如果有东西需要类型转换器或什么的,因为它目前显示,不知道到底是什么你已经成为你犯这个错误的罪魁祸首了。可能必须显示一些代码。 – 2014-12-04 16:15:12