This is a migrated thread and some comments may be shown as answers.

ListBox ItemsPanel TransitionControl

1 Answer 122 Views
TransitionControl
This is a migrated thread and some comments may be shown as answers.
Bobby Ross
Top achievements
Rank 1
Bobby Ross asked on 22 Nov 2014, 10:17 PM
I have a small application for editing elements on a Canvas placed inside a ListBox as the ItemsPanel.  As the CurrentSlide via timer or pager buttons I would like the Transitions to be displayed against the entire canvas.
What would be the best way to place the Canvas into a TransitionControl and notify it that the outer CurrentSlide has changed.  I would prefer not placing the entire ListBox within a DataTemplate which is the only available option I can see off hand.  Any help would be appreciated.


<TextBlock Text="{Binding CurrentSlide.Name}" />
<TextBlock Text="{Binding CurrentSlide.Description}" />
  
// Would like to overlay Transitions onto the Listbox below when the CurrentSlide changes.  Listbox uses a canvas to position and render elements.
<ListBox x:Name="SlideList" BorderBrush="Transparent" BorderThickness="0" ItemsSource="{Binding CurrentSlide.Elements}" SelectionChanged="SlideList_SelectionChanged" >
                                    <ListBox.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <Canvas x:Name="editCanvas"  Background="{Binding CurrentSlide.Background, Converter={StaticResource BackgroundConverter}}" />
  
                                        </ItemsPanelTemplate>
                                    </ListBox.ItemsPanel>
</ListBox>

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 26 Nov 2014, 04:23 PM
Hi Bobby,

In order to avoid using a DataTemplate you would need to extract the ListBox control into a UserControl and set it as content of RadTransitionControl. Afterwards setting a new UserControl with a different DataContext as a Content of RadTransitionControl will allow you to achieve the desired. We have created a sample project that demonstrates the described approach - please, check ti.

We hope this will help you. 

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TransitionControl
Asked by
Bobby Ross
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or