Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 发生XAMLParseException_C#_Xaml - Fatal编程技术网

C# 发生XAMLParseException

C# 发生XAMLParseException,c#,xaml,C#,Xaml,在我的XAML代码中,我遇到了一个奇怪的错误,我不知道如何修复。我有一个错误说明: PresentationFramework.dll中首次出现类型为“System.Windows.Markup.XamlParseException”的异常 其他信息:“Verton\u For\u Windows\u Desktop.MainWindow”的初始化引发异常。“行号“66”和行位置“7” 这是我的密码: <Controls:MetroWindow x:Class="Verton_For_Wi

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

PresentationFramework.dll中首次出现类型为“System.Windows.Markup.XamlParseException”的异常

其他信息:“Verton\u For\u Windows\u Desktop.MainWindow”的初始化引发异常。“行号“66”和行位置“7”

这是我的密码:

<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>

行号和位置告诉您问题所在。文件的最后一行-缺少控件的结束标记:MetroWindow

谢谢您的回复,我实际上忘记了复制和粘贴代码的最后一行opps。然而,我自己也能弄明白。再次感谢您的回复。