I am using the datasource example from the sample viewer. Here is what I would like to accomplish.
I am using the carousel to list all of the file types in a specific directory. My first attempt was to put a regular list box in the template
<DataTemplate x:Key="DocDataTemplate"> <Grid HorizontalAlignment="Center" Width="170" Height ="100">
="ListBox_MouseDoubleClick" >
<ListBoxItem>Test1</ListBoxItem>
<!--<TextBlock
</Grid>
Visually it looks great. check out how I can select an item. I have even hooked its double click event... but I have no way of getting to each list box to add the directory info for each file type.
I guess my ultimate question would be how is the best way to go about this. can I get to the list box by way of the carousel item with regular C# code? So far I only see the xml code not the listbox object instance.
Could I bind to a dataset and add items without using the list box... while retaining the double click event so that I can allow my users to indicate which item the would like? thanks!
TextWrapping="Wrap"
Margin="0,0,0,0"
VerticalAlignment="Center"
Width="Auto"
Height="Auto"
Grid.Row="1"
Text="{Binding XPath=Summary, Mode=Default}"
FontSize="10"
HorizontalAlignment="Left"/>-->
Hello,
You should get the listbox instance as a Content of the CarouselListBoxItem. I have created simple example and the thing I think you are trying to achieve should look something like this :
var a = xamCarouselListBox1.Items[0]; ListBox listbox = (a as CarouselListBoxItem).Content as ListBox; listbox.Items.Add("test5");
Let me know if that is helpful.
Alex.