开发者

WPF C# - Using Xaml to load folder of images

In my on going quest to learn C#, both winforms and WPF, I have whipped up a program similar to visio in WPF. Its using the new WPF ribbon control, and am using a expander to hold some basic shapes that can be made in Xaml(ie. Ellipse), and the shapes are stored in a 'shapebox' that the shapes can later be dragged开发者_Python百科 onto the form and manipulated from there.

None of the current shapes are from images, which is my next goal. What Im looking to do is load the images via XAML and add them to this shapebox just the same. The shapebox is a custom class.

My question is this: How would I go about loading images from file using only xaml?


I found the information I was after.

Simply loading an image using xaml is:

<Image Source="/blah/image.png" />

This works for Images included, not external. To load external images Im not sure.


You should read msdn articles they provide complete set of solutions for every problem. Still, I can give you quick link to solve your problem, you can add both through XAML or ViewModel(if you follow MVVM). Try this link: Adding Images and Icons

still if you dont get any help, please revert back.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜