How can access a CollectionControl on an AvalonDock panel?
Specifically I have the following:
This doesn't really work well and seems over complicated to me. Is there an easier way?
Many thanks for any help.
Specifically I have the following:
<avalonDock:DockingManager x:Name="dockManager">
<avalonDock:DockingManager.LayoutItemTemplateSelector>
<local:PanesTemplateSelector x:Name ="dddd">
<local:PanesTemplateSelector.ConstructionTemplate>
<DataTemplate x:Name="wwww">
<Grid Name="ParentGrid" Background="{DynamicResource WindowBackgroundBrush}">
<ScrollViewer HorizontalScrollBarVisibility="Visible">
<Grid Grid.Row="0">
<xctk:CollectionControl x:Name="CollectionControlElements2"
Grid.Row="2"
ItemsSource="{Binding ElementCollection, Mode=TwoWay}"
ItemAdded="Persist_Changes"
ItemDeleted="Persist_Changes"
SelectedItem="{Binding SelectedElement, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
NewItemTypes="{Binding ElementTypes, Mode=OneWay}">
</xctk:CollectionControl>
</Grid>
</ScrollViewer>
</Grid>
</DataTemplate>
</local:PanesTemplateSelector.ConstructionTemplate>
and in the code behind I try:Dim mytemplate = myfrmMDI.dddd.ConstructionTemplate
Dim myobj As Object = mytemplate.FindName("CollectionControlElements2", myfrmMDI)
(where myfrmMDI is defined on Window_Loaded event)This doesn't really work well and seems over complicated to me. Is there an easier way?
Many thanks for any help.