I need to add and delete items from the carousel at run time based on user input. any samples around? Also, I need to bring up an edit dialog (custom form) on double click. Also need to attach a context menu to items. I've been wading through the excellent infrigistics documentation and haven't found what I need yet.
The XamCarouselPanel and XamCarouselListBox are both standard WPF controls. As a result, any WPF sample you find which demonstrates how to use a WPF Panel and WPF ListBox can be used with these two controls. If you do a Google search on WPF ListBox or look in any WPF book you will find samples how to add list box items, how to delete items, attach contextual menus and act on routed events.
To programmatically add or delete items from a ListBox and a XamCarouselListBox control, you call the Add or Insert, and Remove or RemoveAt methods found in the Items property.
For example, the following C# example adds a Rectangle to a XamCarouselListBox named "carousel":
carousel.Items.Add(new Rectangle());
To assign an event handler to a mouse double-click event on the carousel, you can assign the handler to the MouseDoubleClick event on the carousel or on each individual item added to the list box. Visual Studio and Expression Blend both provide shortcuts to make it easy to add events to WPF controls.
FYI: We offer a WPF Boot Camp and NetAdvantage for WPF public course to empower users to take advantage of WPF features, Expression Blend and Visual Studio functionality to get the most out of NetAdvantage. In the class I demonstrate several of the shortcuts for adding events and how the controls take advantage of WPF.
To learn more about the public course, check out the following site:
http://es.infragistics.com/services/training.aspx#Training
We'll even come to your office to provide hands-on training. If your company wishes to take advantage of this service, please let us know.
Thank you,
thanks.
I was working with too low level a carousel type and didn't realize. I've got the "add" working now. Well, sort of. Trying to add an image programatically.
Thanks for the offer Curtis. I figured it out about 10 minutes later. I apologize, the comment wasn't a plea for help. Needed to add a stack panel, with image and lable. The had to figure out how to get the content of the lable back out on a click. All is fine with the carousel now. Next on the list is figureing out drag/drop operations. haven't coded a drag / drop operation in years.
Find any sample which adds images programmatically to a WPF ListBox and you will find it works the same with the XamCarouselListBox. If you can't find a good sample, I will be happy to write some snippet code/xaml for you.
Thanks,