views:

29

answers:

2

I need to write some listViewItem ( using WPF ) - that contain image, text and button.

I want to inherit from the simple listViewItem class and add to the listview item that contain the three items ( image, text, button ).

I don't understand how the listView control will arrange the 3 items ( image , text, button ) in the right order in the control - how to tell the listview control that the image is first, text is second and the button is the third ?

+1  A: 

First read more about Layout controls. like StackPanel and Grid - so you can understans how to arrange items.Then read about templates. Solution for a task which is very similar to yours is given here: http://www.codewrecks.com/blog/index.php/2008/03/26/first-steps-on-wpf-listview-with-template-based-on-data/

Bashir Magomedov
A: 

I know all about the stackpanel and Grid - but still i can't find how i adding dynamicly a new item that contain those 3 controls. If i need to do it in 'hard code' thru the xaml i know how to do it - by dynamicly .. ?

I want to send my ListView.add(...) method 3 parameters - bitmapSource, text, button - and the listview need to add those 3 as one item.

this is what i dont know how to do :(

Yanshof