如何修复此错误:'在'System.Windows.Baml2006.TypeConverterMarkupExtension'上提供值

时间:2015-01-26 11:56:37

标签: c# .net

我显示了此错误:Provide value on System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '7' and line position '10'.

这是代码

<Window
    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" mc:Ignorable="d" x:Class="UI.MainWindow"
    Title="Renting Cars" Height="700" Width="1100">
<Window.Background>
    <ImageBrush ImageSource="file:///H:/dotNet5775_Project01_8939_4636 2/Images/Icon.png" Stretch="UniformToFill"/>
</Window.Background>

<Grid Margin="0,0,0,1">
    <Grid.Background>
        <ImageBrush Stretch="Fill"/>
    </Grid.Background>

    <Menu Margin="0,0,0,609">
        <Menu.BorderBrush>
            <LinearGradientBrush>
                <GradientStop Color="Black" Offset="0"/>
                <GradientStop Color="White" Offset="1"/>
            </LinearGradientBrush>
        </Menu.BorderBrush>
        <Menu.Background>
            <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
                <GradientStop Color="Black"/>
                <GradientStop Color="White" Offset="1"/>
                <GradientStop Color="#FF737373" Offset="0.01"/>
            </LinearGradientBrush>
        </Menu.Background>

        <MenuItem Header="Client" FontFamily="MV Boli" FontSize="30">
            <MenuItem Header="Add Client" Click="ClickAddClient"/>
            <MenuItem Header="Update Client" Click="UpdateClient_Click" />
            <MenuItem Header="Remove Client" Click="DeleteClient_Click"/>
        </MenuItem>

        <MenuItem Header="Car" FontFamily="MV Boli" FontSize="30" >
            <MenuItem Header="Add Car" Click="AddCar_Click_1"/>
            <MenuItem Header="Update Car" Click="UpdateCar_Click_1"/>
            <MenuItem Header="Remove Car" Click="RemoveCar_Click_1"/>
        </MenuItem>

        <MenuItem Header="Fault" FontFamily="MV Boli" FontSize="30" >
            <MenuItem Header="Add Fault" Click="AddFault_Click_1"/>
            <MenuItem Header="Update Fault"/>
            <MenuItem Header="Remove Fault"/>
        </MenuItem>


    </Menu>

</Grid>

如果您能告诉我问题是什么,那将非常有用。

1 个答案:

答案 0 :(得分:1)

  1. 转到使用过的图像右键单击转到属性
  2. “构建操作”设置“资源”
  3. 然后清理解决方案和构建