ListBox ItemsPanel TransitionControl

2 posts, 0 answers
  1. Bobby Ross
    Bobby Ross avatar
    18 posts
    Member since:
    Nov 2004

    Posted 22 Nov 2014 Link to this post

    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>
  2. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 26 Nov 2014 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top