I have some code of c# and i want to add some images in c# code via url but it is not happen to add so please tell me what is wrong in this code. My project name is ProjectDemo and i have folder images that have maintain all images.
private void Window_Loaded(object sender, RoutedEventArgs e)
{
collection = new ObservableCollection<Image> {
new Image{ Height=128, Width=128,Source=new BitmapImage(new Uri("/ProjectDemo;component/images/highway.png", UriKind.Relative))} ,
new Image{Height=128, Width=128,Source=new BitmapImage(new Uri("/ProjectDemo;component/images/highway-1.png", UriKind.Relative))},
new Image{ Height=128, Width=128,Source=new BitmapImage(new Uri("/ProjectDemo/images/part-5.png", UriKind.Relative))} ,
new Image{Height=128, Width=128,Source=new BitmapImage(new Uri("/ProjectDemo;component/images/part-6.png", UriKind.Relative))} ,
new Image{ Height=128, Width=128,Source=new BitmapImage(new Uri("/ProjectDemo;component/images/part-7.png", UriKind.Relative))} ,
new Image{Height=128, Width=128,Source=new BitmapImage(new Uri("/ProjectDemo;component/images/part-8.png", UriKind.Relative))} ,
new Image{ Height=128, Width=128,Source=new BitmapImage(new Uri("/ProjectDemo;component/images/speed-1.png", UriKind.Relative))} ,
new Image{Height=128, Width=128,Source=new BitmapImage(new Uri("/ProjectDemo;component/images/speedroad.png", UriKind.Relative))}
};
FirstListBox.Items.Add(collection[0]);
FirstListBox.Items.Add(collection[1]);
FirstListBox.Items.Add(collection[2]);
FirstListBox.Items.Add(collection[3]);
FirstListBox.Items.Add(collection[4]);
FirstListBox.Items.Add(collection[5]);
FirstListBox.Items.Add(collection[6]);
FirstListBox.Items.Add(collection[7]);
}