首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Visual Studio XAML网站。Xaml无法加载

Visual Studio XAML网站。Xaml无法加载
EN

Stack Overflow用户
提问于 2011-04-22 03:06:59
回答 1查看 462关注 0票数 0

下面是.aspx页面:

代码语言:javascript
复制
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Vowels.aspx.cs" Inherits="XMLPraktijkOpdrachtJavascript.Vowels" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>Vowels</title>
        <script type="text/javascript" src="Javascript/Vowels.js"></script>
    </head>
    <body>
        <object id="VowelsPage" width="100%" height="100%" type="application/x-silverlight">                
            <param name="source" value="Xaml/Vowels.xaml"/>             
        </object>                   
    </body>
</html>

使用此xaml文件:

http://pastebin.com/1sFX93Bp (在这里发表有点长)

但是我的页面根本不能加载。上面写着白色。但是,如果我注释掉第20行中的所有内容,它确实可以工作(即:执行剩余的代码)。

问题可能是什么,或者有没有像样的Xaml调试器?因为Visual Studio不允许在xaml文件中放置断点。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-04-24 10:10:38

你能把这个换一下吗?

代码语言:javascript
复制
TargetType="{x:Type TextBlock}"

代码语言:javascript
复制
TargetType="TextBlock"

此外,您还需要删除

代码语言:javascript
复制
<Setter Property="Background" Value="#FF3B596E"/>
<Setter Property="Background" Value="#FF3B5940"/>

和改变

代码语言:javascript
复制
<Setter Property="FontSize" Value="24px"/>
<Setter Property="FontSize" Value="14px"/>
<Setter Property="FontSize" Value="14px"/>

代码语言:javascript
复制
<Setter Property="FontSize" Value="24"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontSize" Value="14"/>

完整的xaml脚本如下所示:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<Grid
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

  Loaded="OnLoaded">

    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="600"/>
        <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>

    <Grid.Background>
        <LinearGradientBrush>
            <GradientStop Color="Red"/>
            <GradientStop Color="#FF3B596E" Offset="1"/>
        </LinearGradientBrush>
    </Grid.Background>
    <Grid Grid.Column="1" Grid.Row="1">
        <Grid.Resources>
            <Style x:Key="TitleText"
             TargetType="TextBlock">
                <Setter Property="FontFamily" Value="Segoe Black"/>
                <Setter Property="FontSize" Value="24"/>
                <Setter Property="Foreground" Value="MidnightBlue"/>
                <Setter Property="TextAlignment" Value="Center"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
            </Style>
            <Style x:Key="LabelText"
             TargetType="TextBlock">
                <Setter Property="FontFamily" Value="Segoe Black"/>
                <Setter Property="FontSize" Value="14"/>
                <Setter Property="Foreground" Value="#FFB3B4C1"/>
                <Setter Property="TextAlignment" Value="Center"/>
                <Setter Property="VerticalAlignment" Value="Center"/>

            </Style>
            <Style x:Key="ValueText"
             TargetType="TextBlock">
                <Setter Property="FontFamily" Value="Segoe Black"/>
                <Setter Property="FontSize" Value="14"/>
                <Setter Property="Foreground" Value="Ivory"/>
                <Setter Property="TextAlignment" Value="Center"/>
                <Setter Property="VerticalAlignment" Value="Center"/>

            </Style>
        </Grid.Resources>
        <Grid.Background>
            <LinearGradientBrush>
                <GradientStop Color="#93C5E8"/>
                <GradientStop Color="#3B596E" Offset="1"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="3*"/>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="3*"/>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="3*"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="70"/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock Grid.ColumnSpan="6" Style="{StaticResource TitleText}">
                    Vowel Details
        </TextBlock>
        <TextBlock Grid.Column="0" Grid.Row="1" Style="{StaticResource LabelText}">Strings with frequency &gt; 50</TextBlock>
        <Button Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Center"
           Content="Sort"
           Grid.Column="0"
           Grid.Row="4"
           Name="btnSort50"/>
        <TextBlock Grid.Column="1" Grid.Row="1" Style="{StaticResource ValueText}">128</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="1" Style="{StaticResource LabelText}">Starting with a Vowel</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="1" Style="{StaticResource ValueText}">51</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="2" Style="{StaticResource LabelText}">a</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="2" Style="{StaticResource ValueText}">12</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="3" Style="{StaticResource LabelText}">e</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="3" Style="{StaticResource ValueText}">22</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="4" Style="{StaticResource LabelText}">i</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="4" Style="{StaticResource ValueText}">7</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="5" Style="{StaticResource LabelText}">o</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="5" Style="{StaticResource ValueText}">7</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="6" Style="{StaticResource LabelText}">u</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="6" Style="{StaticResource ValueText}">3</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="1" Style="{StaticResource LabelText}">Ending with a Vowel</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="1" Style="{StaticResource ValueText}">52</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="2" Style="{StaticResource LabelText}">a</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="2" Style="{StaticResource ValueText}">7</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="3" Style="{StaticResource LabelText}">e</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="3" Style="{StaticResource ValueText}">27</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="4" Style="{StaticResource LabelText}">i</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="4" Style="{StaticResource ValueText}">5</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="5" Style="{StaticResource LabelText}">o</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="5" Style="{StaticResource ValueText}">9</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="6" Style="{StaticResource LabelText}">u</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="6" Style="{StaticResource ValueText}">4</TextBlock>
        <TextBlock Grid.Column="0" Grid.Row="7" Style="{StaticResource LabelText}">Strings with frequency &gt; 40</TextBlock>
        <Button Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Center"
           Content="Sort"
           Grid.Column="0"
           Grid.Row="10"
           Name="btnSort40"/>
        <TextBlock Grid.Column="1" Grid.Row="7" Style="{StaticResource ValueText}">182</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="7" Style="{StaticResource LabelText}">Starting with a Vowel</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="7" Style="{StaticResource ValueText}">78</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="8" Style="{StaticResource LabelText}">a</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="8" Style="{StaticResource ValueText}">15</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="9" Style="{StaticResource LabelText}">e</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="9" Style="{StaticResource ValueText}">36</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="10" Style="{StaticResource LabelText}">i</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="10" Style="{StaticResource ValueText}">13</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="11" Style="{StaticResource LabelText}">o</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="11" Style="{StaticResource ValueText}">10</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="12" Style="{StaticResource LabelText}">u</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="12" Style="{StaticResource ValueText}">4</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="7" Style="{StaticResource LabelText}">Ending with a Vowel</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="7" Style="{StaticResource ValueText}">75</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="8" Style="{StaticResource LabelText}">a</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="8" Style="{StaticResource ValueText}">14</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="9" Style="{StaticResource LabelText}">e</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="9" Style="{StaticResource ValueText}">38</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="10" Style="{StaticResource LabelText}">i</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="10" Style="{StaticResource ValueText}">8</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="11" Style="{StaticResource LabelText}">o</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="11" Style="{StaticResource ValueText}">10</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="12" Style="{StaticResource LabelText}">u</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="12" Style="{StaticResource ValueText}">5</TextBlock>
        <TextBlock Grid.Column="0" Grid.Row="13" Style="{StaticResource LabelText}">Strings with frequency &gt; 30</TextBlock>
        <Button Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Center"
           Content="Sort"
           Grid.Column="0"
           Grid.Row="16"
           Name="btnSort30"/>
        <TextBlock Grid.Column="1" Grid.Row="13" Style="{StaticResource ValueText}">247</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="13" Style="{StaticResource LabelText}">Starting with a Vowel</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="13" Style="{StaticResource ValueText}">100</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="14" Style="{StaticResource LabelText}">a</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="14" Style="{StaticResource ValueText}">18</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="15" Style="{StaticResource LabelText}">e</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="15" Style="{StaticResource ValueText}">48</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="16" Style="{StaticResource LabelText}">i</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="16" Style="{StaticResource ValueText}">19</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="17" Style="{StaticResource LabelText}">o</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="17" Style="{StaticResource ValueText}">11</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="18" Style="{StaticResource LabelText}">u</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="18" Style="{StaticResource ValueText}">4</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="13" Style="{StaticResource LabelText}">Ending with a Vowel</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="13" Style="{StaticResource ValueText}">103</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="14" Style="{StaticResource LabelText}">a</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="14" Style="{StaticResource ValueText}">19</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="15" Style="{StaticResource LabelText}">e</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="15" Style="{StaticResource ValueText}">55</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="16" Style="{StaticResource LabelText}">i</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="16" Style="{StaticResource ValueText}">10</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="17" Style="{StaticResource LabelText}">o</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="17" Style="{StaticResource ValueText}">13</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="18" Style="{StaticResource LabelText}">u</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="18" Style="{StaticResource ValueText}">6</TextBlock>
        <TextBlock Grid.Column="0" Grid.Row="19" Style="{StaticResource LabelText}">Strings with frequency &gt; 20</TextBlock>
        <Button Height="23" HorizontalAlignment="Stretch" VerticalAlignment="Center"
           Content="Sort"
           Grid.Column="0"
           Grid.Row="22"
           Name="btnSort20"/>
        <TextBlock Grid.Column="1" Grid.Row="19" Style="{StaticResource ValueText}">392</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="19" Style="{StaticResource LabelText}">Starting with a Vowel</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="19" Style="{StaticResource ValueText}">170</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="20" Style="{StaticResource LabelText}">a</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="20" Style="{StaticResource ValueText}">34</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="21" Style="{StaticResource LabelText}">e</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="21" Style="{StaticResource ValueText}">77</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="22" Style="{StaticResource LabelText}">i</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="22" Style="{StaticResource ValueText}">29</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="23" Style="{StaticResource LabelText}">o</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="23" Style="{StaticResource ValueText}">21</TextBlock>
        <TextBlock Grid.Column="2" Grid.Row="24" Style="{StaticResource LabelText}">u</TextBlock>
        <TextBlock Grid.Column="3" Grid.Row="24" Style="{StaticResource ValueText}">9</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="19" Style="{StaticResource LabelText}">Ending with a Vowel</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="19" Style="{StaticResource ValueText}">161</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="20" Style="{StaticResource LabelText}">a</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="20" Style="{StaticResource ValueText}">27</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="21" Style="{StaticResource LabelText}">e</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="21" Style="{StaticResource ValueText}">81</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="22" Style="{StaticResource LabelText}">i</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="22" Style="{StaticResource ValueText}">24</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="23" Style="{StaticResource LabelText}">o</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="23" Style="{StaticResource ValueText}">20</TextBlock>
        <TextBlock Grid.Column="4" Grid.Row="24" Style="{StaticResource LabelText}">u</TextBlock>
        <TextBlock Grid.Column="5" Grid.Row="24" Style="{StaticResource ValueText}">9</TextBlock>
    </Grid>
</Grid>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5748608

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档