[英]System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '6' and line position '10
I have add an Image resource for the wpf project am making by: 我为wpf项目添加了一个Image资源:
right-click on the Project -> Properties -> Resources -> Images -> From Existing -> ClientBackGround.png
and I made it background for the main window : 我把它作为主窗口的背景:
<Window x:Class="Illuminate_AutoPatcher.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Width="1000" Height="750" ResizeMode="NoResize" WindowStyle="None" WindowStartupLocation="CenterScreen">
<Window.Background>
<ImageBrush ImageSource="pack://siteoforigin:,,,/Resources/ClientBackground.png"/>
</Window.Background>
<Grid>
<Button Content="" HorizontalAlignment="Left" VerticalAlignment="Top" Width="224" Margin="766,613,0,0" Height="124" >
</Button>
</Grid>
</Window>
but it's not working it's keep throwing this anoying error System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '6' and line position '10
但它没有工作它继续抛出这个恼人的错误System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '6' and line position '10
System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '6' and line position '10
, how I supposed to fix it, so I use static resources that's build with the project? System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '6' and line position '10
,我应该如何解决它,所以我使用与项目一起构建的静态资源?
@HighCore is right, using application solves your issue in the given scenario @HighCore是对的,使用应用程序解决了给定方案中的问题
<ImageBrush ImageSource="pack://application:,,,/Resources/ClientBackground.png"/>
You still can use siteoforigin . 你仍然可以使用siteoforigin 。 For that you have to set the image property 为此,您必须设置图像属性
Copy to Output Directory to " Copy always " 复制到输出目录为“ 始终复制 ”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.