Xaml解析异常未处理

时间:2012-03-08 20:18:41

标签: c# wpf xaml

我在运行这个正在运行的应用程序时遇到错误!

{"'在类型' WpfApplication1.MainWindow'上调用构造函数匹配指定的绑定约束引发异常。'行号' 3'和行位置' 9'。"}

<Window 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   x:Class="WpfApplication1.MainWindow"
    Title="Smart Voice" Height="480" Width="800" Background="#FFAA8989"  AllowsTransparency="False" Topmost="True">
<Window.Resources>
    <Storyboard x:Key="appStatsBox Change">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="appStatsBox">
            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.5"/>
            <EasingDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="skypeStatusBox Changed">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="skypeStatusBox">
            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.5"/>
            <EasingDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="messageBoxInfo Changed">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="messageBoxInfo">
            <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.5"/>
            <EasingDoubleKeyFrame KeyTime="0:0:2" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
</Window.Resources>
<Window.Triggers>
    <EventTrigger RoutedEvent="TextBoxBase.TextChanged" SourceName="appStatsBox">
        <BeginStoryboard x:Name="appStatsBox_Change_BeginStoryboard" Storyboard="{StaticResource appStatsBox Change}"/>
    </EventTrigger>
    <EventTrigger RoutedEvent="TextBoxBase.TextChanged" SourceName="skypeStatusBox">
        <BeginStoryboard x:Name="skypeStatusBox_Changed_BeginStoryboard" Storyboard="{StaticResource skypeStatusBox Changed}"/>
    </EventTrigger>
    <EventTrigger RoutedEvent="TextBoxBase.TextChanged" SourceName="messageBoxInfo">
        <BeginStoryboard x:Name="skypeStatusBox_Changed_BeginStoryboard1" Storyboard="{StaticResource messageBoxInfo Changed}"/>
    </EventTrigger>
</Window.Triggers>
<Grid>
    <Grid.Background>
        <RadialGradientBrush>
            <GradientStop Color="Black" Offset="0"/>
            <GradientStop Color="White" Offset="1"/>
        </RadialGradientBrush>
    </Grid.Background>
    <TextBox Height="426" HorizontalAlignment="Left" Margin="505,8,0,0" x:Name="contactsBox" VerticalAlignment="Top" Width="271" Background="#FF2D2424" IsReadOnly="True" Focusable="False" Foreground="White" TextWrapping="Wrap" FontFamily="Trebuchet MS" FontSize="16" >
        <TextBox.Effect>
            <DropShadowEffect/>
        </TextBox.Effect>
    </TextBox>
    <TextBox Background="#FF2D2424" Focusable="False" FontFamily="Trebuchet MS" FontSize="20" Foreground="White" Height="72" HorizontalAlignment="Left" IsReadOnly="True" Margin="8,362,0,0" x:Name="callInfoBox" TextWrapping="NoWrap" VerticalAlignment="Top" Width="491" Text="Call information" >
        <TextBox.Effect>
            <DropShadowEffect/>
        </TextBox.Effect>
    </TextBox>
    <TextBox Background="#FF242020" Focusable="False" FontFamily="Trebuchet MS" FontSize="18.667" Foreground="White" Height="44" HorizontalAlignment="Left" IsReadOnly="True" Margin="8,8,0,0" x:Name="appStatsBox" Text="Standby" VerticalAlignment="Top" Width="245" FontStyle="Italic" FontWeight="Bold" TextAlignment="Center">
        <TextBox.Effect>
            <DropShadowEffect/>
        </TextBox.Effect>
    </TextBox>
    <TextBox Background="#FF2D2424" Focusable="False" FontFamily="Trebuchet MS" FontSize="18" Foreground="White" Height="234" HorizontalAlignment="Left" IsReadOnly="True" Margin="8,107,0,0" x:Name="messageBoxBody" TextWrapping="Wrap" VerticalAlignment="Top" Width="491" Text="Welcome to Smart Voice. Any new messages from skype will appear here. Have a nice trip :)" >
        <TextBox.Effect>
            <DropShadowEffect/>
        </TextBox.Effect>
    </TextBox>
    <TextBox Background="#FF2D2424" Focusable="False" FontFamily="Trebuchet MS" FontSize="18" Foreground="White" Height="33" HorizontalAlignment="Left" IsReadOnly="True" Margin="8,70,0,0" x:Name="messageBoxInfo" Text="Message Box" TextWrapping="NoWrap" VerticalAlignment="Top" Width="491" >
        <TextBox.Effect>
            <DropShadowEffect/>
        </TextBox.Effect>
    </TextBox>
    <TextBox Background="#FF2D2424" Focusable="False" FontFamily="Trebuchet MS" FontSize="18.667" Foreground="White" Height="44" IsReadOnly="True" Margin="257,8,285,0" x:Name="skypeStatusBox" TextWrapping="NoWrap" VerticalAlignment="Top" TextAlignment="Center" >
        <TextBox.Effect>
            <DropShadowEffect/>
        </TextBox.Effect>
    </TextBox>
</Grid>

MainWindow构造函数:

public partial class MainWindow : Window
{
    SkypeLink skype = new SkypeLink();
    VoiceSynth voiceSynth = new VoiceSynth();
    VoiceRecognizer voiceRecognizer = new VoiceRecognizer();
    GPS gps = new GPS();
    DispatcherTimer contactsTimer = new DispatcherTimer();
    DispatcherTimer callTimer = new DispatcherTimer();
}

0 个答案:

没有答案