J
Jeroen van Langen
?Hi,
I'm always struggling with wpf/xaml. The image is in the resource..
Why can I use
<image name="testimage" source="test.png">
but in code this fails..
testimage.source = "test.png";
of course.. a string isn't a ImageSource...
but,
testimage.source = new BitmapImage(new Uri( "test.png")); // won't do the
trick either,
Invalid URI: The format of the URI could not be determined. .. this makes it
complicated.....
is there a way to solve it like 'they' do?
something like: testimage.source =
ToImageSourceConvertor.FromString("test.png");
wpf/xaml is way different than forms, many things are below the surface and
can't be traced. Most of the time I'm busy with researching instead of
developing.
Jeroen
I'm always struggling with wpf/xaml. The image is in the resource..
Why can I use
<image name="testimage" source="test.png">
but in code this fails..
testimage.source = "test.png";
of course.. a string isn't a ImageSource...
but,
testimage.source = new BitmapImage(new Uri( "test.png")); // won't do the
trick either,
Invalid URI: The format of the URI could not be determined. .. this makes it
complicated.....
is there a way to solve it like 'they' do?
something like: testimage.source =
ToImageSourceConvertor.FromString("test.png");
wpf/xaml is way different than forms, many things are below the surface and
can't be traced. Most of the time I'm busy with researching instead of
developing.
Jeroen