简体   繁体   中英

How do I fix this error : 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension'

I've got this error displayed: Provide value on System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '7' and line position '10'. Provide value on System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '7' and line position '10'.

Here is the code

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

It would be really helpful if you could tell me what the problem is.

  1. go to used image right click go to properties
  2. "Build Action" Set "Resource"
  3. then clean Solution and Build

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM