I am using these method to load images and resource directory dynamically, but they do not work in every case
new Uri(@"pack://application:,,/Images/lession_tab.png");
this method donot work for image but it work for Resource file.
new Uri("/project;component/Resources/Dictionary1.xaml", UriKind.Relative);
this method donot work for resouce directory but it works for image.
if i am getting this correctly pack://application work to get the local assesmbly path then why this not working for images
it is giving the exception Cannot locate resource ‘images/lession_tab.png’.
IIRC, images are by default added to the project “as Content” not “as Resource”, and I’m not sure if you can refer to “content” with this URI syntax. What they have buildaction do they have? Resource or Content? If Content, I think you should just use plain URL like “/blah/image.png”. Check http://msdn.microsoft.com/en-us/library/aa970069.aspx although they have there some strange wordings in a few places..
Another thing is that pack/application has three commas: like
pack://application:,,,/ContentFile.xamlnot two! Each ‘,’ stands for an empty sub-locator, so make sure you tried with three, as the location meaning changes..