相关疑难解决方法(0)

如何在WPF窗口中更改标题栏图像?

如何更改WPF中的标题栏图像(左上角最左边的图标)?

wpf

32
推荐指数
3
解决办法
5万
查看次数

XAML解析异常 - xmlns:x ="http://schemas.microsoft.com/winfx/2006/xaml"

我昨晚在PC上使用VS 2010 Ultimate开发了一个WPF项目.

我刚刚在我的上网本上用VS C#2010 Express打开了它.

当我尝试运行它时,我抛出了一个XAML Parse异常,告诉我该行:

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Run Code Online (Sandbox Code Playgroud)

是问题.我看不出它的问题,我从来没有改变它,看起来它应该是它应该是什么.

错误:

'The invocation of the constructor on type 'WpfApplication1.MainWindow' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'.
Run Code Online (Sandbox Code Playgroud)

完整的XAML:

<Window x:Class="WpfApplication1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Camera" Height="550" Width="826" Background="#ddd" ResizeMode="NoResize" WindowStyle="None" MouseLeftButtonDown="Window_MouseLeftButtonDown" BorderBrush="#FF8D8D8D" BorderThickness="2" >
<Window.Resources>
    <Style TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                   <ContentPresenter
              Margin="{TemplateBinding Control.Padding}"
              HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
              VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
              SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"
              ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
              RecognizesAccessKey="True"
              Content="{TemplateBinding ContentControl.Content}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</Window.Resources> …
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml

19
推荐指数
1
解决办法
2万
查看次数

标签 统计

wpf ×2

c# ×1

xaml ×1