Monika Dyrda

WPF Dev Girl

December 2008 - Posts

Merry Christmas!
Merry Christmas and Happy New Year!

ChristmasTree

Posted: Dec 24 2008, 02:22 PM by xmonix | with 1 comment(s)
Filed under:
WPF ImageSource

A little How-to put an image from embedded resources into your WPF application. I have found it very useful especially when working with ListView and creating value converters for it.

My solution for this examples looks like that:

ImageSourceExampleSolution

 

1) ImageSource in XAML:

<Image Name="image1" 
Source="/ImageSourceExample;component/Assets/flower.jpg" />

Where ImageSourceExample is the assembly name.

2) ImageSource in c#

ImageSourceConverter imgConv = new ImageSourceConverter();
string path = "pack://application:,,/Assets/flower.jpg"
ImageSource imageSource = (ImageSource) imgConv.ConvertFromString(path);
image1.Source = imageSource;

To read more about pack URIs in WPF look here.

Monika

Posted: Dec 13 2008, 10:18 PM by xmonix | with no comments
Filed under:
Hello World!

As everyone can see this is my first blog post. I had some problems on startup but now I know all I need and an can start posting. I am very excited to share 'crazy WPF things I do' :-)

Thanks to Joe for giving me the opportunity to blog here and Krzysztof for encouraging me to start blogging.

Hope I won't disappoint those guys,

Monika

Posted: Dec 10 2008, 07:22 PM by xmonix | with 3 comment(s)
Filed under:
More Posts