I have a carousel list box that contains multiple rectangles. These rectangles are inside a canvas. The canvas has two text blocks. If the item inside the carousel is selected scrollbars appear. There is no reason for the scrollbars to appear because everything inside the text block displays correctly. I have tried many things like setting ScrollViewer.CanContentScroll="False" and SelectiveScrollingGrid.SelectiveScrollingOrientation="None". Nothings seems to help. Any idea on what changes I need to make the scrollbars hidden? I have supplied a sample of the code. It only contains one rectangle but once selected you will see the scrollbars appear. Maybe my approach is wrong if so I guess I would need to know the recommended way to add items to carousel list box. Thanks in advance.
Thanks for your help. This has resolved my issue.
Hello Michael,
I am just checking if you require any further assistance on the matter.
Thank you for your feedback. I have been looking into your latest issue and if you do not select an item by clicking on it, cycling the carousel does not make the selected item change. I am not sure how the selected item changed when you press the forward button, because when I test it on my side, the ‘SelectionChanged’ event does not fire. Would you please modify your sample in order to demonstrate how the selection changes on pressing the buttons ?
Looking forward to hearing from you.
That is what I needed I couldn't figure out how to change the ItemSize. Thanks for answering all my questions.
When cycling through the items using the forward arrow key all the items cycle correctly and get selected correctly. When I cycle back using the back arrow key the selection keeps the red rectangle selected even though it is currently selected to the Options rectangle. Both items appear to be selected. Is this a bug? It also only seems to happen if I have more than 6 items.
I attached an example that can reproduce the issue. Thanks again.
Thank you for your feedback. In my previous post I have in mind the Canvas by Item in the XamCarouselListBox. I have been looking into your scenario and the best approach to make the scrollbars not appear is to set the ‘ItemSize’ property of the ViewSettings like e.g. :
<igWindows:XamCarouselListBox.ViewSettings>
<igWindows:CarouselViewSettings ItemSize="150,110"/>
</igWindows:XamCarouselListBox.ViewSettings>
In order to change the background of the selected item I can suggest you handle the ‘SelectionChanged’ event like e.g. :
private void CarouselListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.RemovedItems.Count != 0)
(e.RemovedItems[0] as Canvas).Background = Brushes.Transparent;
(e.AddedItems[0] as Canvas).Background = Brushes.Blue;
}
Let me know, if you have any other questions on this matter.