首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >XAMLParseException发生

XAMLParseException发生
EN

Stack Overflow用户
提问于 2015-02-18 02:15:13
回答 1查看 611关注 0票数 0

在我的XAML代码中,我得到了一个奇怪的错误,我不知道如何修复。我有个错误说:

System.Windows.Markup.XamlParseException类型的第一次例外发生在PresentationFramework.dll中

附加信息:'Verton_For_Windows_Desktop.MainWindow‘的初始化引发了异常。行号'66‘和线位置'7’。

这是我的密码:

代码语言:javascript
复制
<Controls:MetroWindow x:Class="Verton_For_Windows_Desktop.MainWindow"
    xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Verton Ai" Height="573.523" Width="358.453" BorderBrush="Black" Background="{x:Null}" GlowBrush="#FF1768FF" WindowTitleBrush="#FF2470FF" TitleForeground="White" Foreground="#FF2470FF" Topmost="True" ShowMaxRestoreButton="False" SaveWindowPosition="True" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" SnapsToDevicePixels="True" SizeToContent="Height">
<Controls:MetroWindow.Resources>
    <Storyboard x:Key="openButton">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="button">
            <EasingDoubleKeyFrame KeyTime="0" Value="44"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="12"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="button">
            <EasingDoubleKeyFrame KeyTime="0" Value="-2"/>
            <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="-2"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
</Controls:MetroWindow.Resources>
<Controls:MetroWindow.Triggers>
    <EventTrigger RoutedEvent="UIElement.MouseEnter" SourceName="button"/>
    <EventTrigger RoutedEvent="FrameworkElement.Loaded">
        <BeginStoryboard Storyboard="{StaticResource openButton}"/>
    </EventTrigger>
</Controls:MetroWindow.Triggers>
<Grid Background="#FF1768FF">
    <Button x:Name="Button1" HorizontalAlignment="Left" Margin="121,455,0,0" VerticalAlignment="Top" Width="81" Style="{DynamicResource MetroCircleButtonStyle}" Height="81" BorderBrush="White" BorderThickness="2" Foreground="{x:Null}" FontSize="200" FontStyle="Italic" Cursor="Hand" Click="Button_Click" RenderTransformOrigin="-0.119,0.431">
        <Button.Background>
            <ImageBrush ImageSource="C:\Users\Blake Weissman\OneDrive\Extra Curricular Stuff\Verton\Verton New\WindowsIcons-master\WindowsPhone\dark\appbar.microphone.png"/>
        </Button.Background>
        <Button.RenderTransform>
            <TransformGroup>
                <ScaleTransform/>
                <SkewTransform/>
                <RotateTransform/>
                <TranslateTransform/>
            </TransformGroup>
        </Button.RenderTransform>
    </Button>
    <TextBox HorizontalAlignment="Left" Height="48" Margin="10,402,0,0" TextWrapping="Wrap" Text="Type Your Command Here, Or Click The Microphone Button To Say Your Command" VerticalAlignment="Top" Width="332" FontSize="15" FontFamily="Segoe UI Light" Background="White" BorderBrush="{x:Null}" Foreground="#FF1768FF" Uid="commandText" IsKeyboardFocusedChanged="TextBox_IsKeyboardFocusedChanged"/>
    <TextBox HorizontalAlignment="Left" Height="374" Margin="10,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="332" Foreground="#FF1768FF" BorderBrush="{x:Null}" FontFamily="Segoe UI Light" FontSize="20"/>
    <Button x:Name="button_Copy2" HorizontalAlignment="Left" Margin="286,480,0,0" VerticalAlignment="Top" Width="66" Style="{DynamicResource MetroCircleButtonStyle}" Height="66" BorderBrush="White" BorderThickness="2" Foreground="{x:Null}" FontSize="200" FontStyle="Italic" Cursor="Hand" Click="Button_Click" RenderTransformOrigin="-0.119,0.431">
        <Button.Background>
            <ImageBrush ImageSource="C:\Users\Blake Weissman\OneDrive\Extra Curricular Stuff\Verton\Verton New\WindowsIcons-master\WindowsPhone\dark\appbar.settings.png"/>
        </Button.Background>
        <Button.RenderTransform>
            <TransformGroup>
                <ScaleTransform/>
                <SkewTransform/>
                <RotateTransform/>
                <TranslateTransform/>
            </TransformGroup>
        </Button.RenderTransform>
    </Button>
    <Button x:Name="button_Copy" HorizontalAlignment="Left" Margin="0,480,0,0" VerticalAlignment="Top" Width="66" Style="{DynamicResource MetroCircleButtonStyle}" Height="66" BorderBrush="White" BorderThickness="2" Foreground="{x:Null}" FontSize="200" FontStyle="Italic" Cursor="Hand" Click="Button_Click" RenderTransformOrigin="-0.119,0.431">
        <Button.Background>
            <ImageBrush ImageSource="C:\Users\Blake Weissman\OneDrive\Extra Curricular Stuff\Verton\Verton New\WindowsIcons-master\WindowsPhone\dark\appbar.settings.png"/>
        </Button.Background>
        <Button.RenderTransform>
            <TransformGroup>
                <ScaleTransform/>
                <SkewTransform/>
                <RotateTransform/>
                <TranslateTransform/>
            </TransformGroup>
        </Button.RenderTransform>
    </Button>
</Grid>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-02-18 03:21:02

电话号码和位置告诉你问题出在哪里。文件的最后一行-缺少控件的结束标记:MetroWindow

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28574855

复制
相关文章

相似问题

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