My problem that I cannot use the image background in my resource but if I use the Directory from the different folder the background work fine. So what should I do?
Here is my code and the error message from visual studio.
<Window x:Class="Jan1_Launcher.MainWindow"
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:Jan1_Launcher"
mc:Ignorable="d"
Title="Jan1" Height="350" Width="525">
<Window.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="#FF4F1212" Offset="1"/>
</LinearGradientBrush>
</Window.Background>
<Grid x:Name="Name">
<Grid.Background>
<ImageBrush ImageSource="a.png"/>
</Grid.Background>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Label x:Name="Game_Name" Content="Jan 1 Survival Game" HorizontalAlignment="Left" Height="24" Margin="21,10,0,0" VerticalAlignment="Top" Width="125"/>
<Label x:Name="label" Content="Patch 0.0.1" HorizontalAlignment="Left" Height="24" Margin="134,16,0,0" VerticalAlignment="Top" Width="69"/>
<Button x:Name="UpdateBut" Content="Download Update" HorizontalAlignment="Left" Height="34" Margin="58,247,0,0" VerticalAlignment="Top" Width="145" IsDefault="True" Click="UpdateBut_Click"/>
<Button x:Name="PlayBut" Content="Play" HorizontalAlignment="Left" Height="34" Margin="322,247,0,0" VerticalAlignment="Top" Width="145" Click="PlayBut_Click" Background="#FF111111" BorderBrush="Black" OpacityMask="Black" Foreground="White" FontSize="14" FontFamily="Arial"/>
</Grid>
</Window>
Error Message:
An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '17' and line position '14'.