locked
How can I have a class declared in a DataTemplate RRS feed

  • General discussion

  • I show you this code:

     

    <ScrollViewer ScrollViewer.VerticalScrollBarVisibility="Auto">

    <ItemsControl ItemsSource="{Binding Lists}">

    <ItemsControl.ItemTemplate>

    <DataTemplate>

    <controls:Selector x:Name="control" ItemsSource="{Binding Root.Children}">

    </controls:Selector>

    </DataTemplate>

    </ItemsControl.ItemTemplate>

    </ItemsControl>

    </ScrollViewer>

    </Grid>

    <Grid Grid.Column="1">

    <TextBlock>

    <ContentControl Content="{Binding SelectedItem,ElemenName=control}" ContentTemplateSelector="{StaticResource templateByType}" />

    </TextBlock>

    </Grid>


    In this case, "ElementName=control" made a problem, I don't know why.

    I have heart that the problem is that the control is defined in DataTemplate.

    Please, can you give me a solution for this problem.

    You can ask me more questions to explain you my situation,

    Regards

    • Changed type Jim Zhou - MSFT Tuesday, October 21, 2008 2:23 AM customer no feedback
    • Changed type Jim Zhou - MSFT Tuesday, October 21, 2008 2:23 AM customer no feedback
    • Changed type Jim Zhou - MSFT Tuesday, October 21, 2008 2:23 AM customer no feedback
    Friday, October 10, 2008 10:55 AM

All replies

  •  
    Hi,

    Could you provide a small ,complete and ready-to-run example to demonstrate  the issue you are encountering?

    Thanks.
    Jim Zhou -MSFT
    Monday, October 13, 2008 5:32 AM
  • Hi,

     

    We are changing the issue type to “Comment” because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question” by clicking the "Options" link at the top of your post, and selecting "Change Type" menu item from the pop menu. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

     

    Thank you!


    Jim Zhou -MSFT
    Thursday, October 16, 2008 9:52 AM