c# WPF开发报错“资源无法解析” ----持续更新

loginView.xaml代码是这样的

		<Window x:Class="CourseManagement.loginView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:CourseManagement"
        mc:Ignorable="d"
        Title="系统登录" Height="600" Width="360"
        FontFamily="Microsoft YaHei" FontWeight="ExtraLight" 
        ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
        WindowStyle="None" AllowsTransparency="True" Background="{x:Null}"
        >
    <Window.Resources >
        <ControlTemplate TargetType="Button"  x:Key=" CloseButtonTemplate">
            <Border Background="Transparent">
                <Path Data="M0 0 12 12M0 12 12 0" Stroke="White" StrokeThickness="1" VerticalAlignment="Center" HorizontalAlignment="Center">
                    
                </Path>
              </Border> 
            
        </ControlTemplate>
    </Window.Resources>
    <Border Margin="5" Background="White" CornerRadius="10">
        <Border.Effect>
            <DropShadowEffect  Color="Gray" ShadowDepth="0 " BlurRadius=" 0" Opacity=" 0.3" Direction=" 0">
                
            </DropShadowEffect>
        </Border.Effect>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="1.8*"/>
                <RowDefinition Height="3*"/>
                <RowDefinition Height="60"/>

            </Grid.RowDefinitions>
            <Border Background="#007DFA"  CornerRadius="10,10,0,0"/>
            <Button VerticalAlignment="Top"  HorizontalAlignment="Right" Width=" 50" Height=" 40"
                    Template="{StaticResource  CloseButtonTemplate }">
                   
              
        </Button>
        </Grid>
        
    </Border>
</Window>
代码片

报错信息见下图
在这里插入图片描述
经过反复调试,最开始以为是.NET版本不对,后来仔细检查代码,发现是
<ControlTemplate TargetType="Button" x:Key=" CloseButtonTemplate">
CloseButtonTemplate前面多了一个空格。
真的是无语!!!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值