locked
How do I find this Control object in code-behind?...

    Question

  • Hi,

    I have an object Control GridView (x:Name="itemGridView") in a DataTemplate inside of a HubSection, but its not available in code-behind using the this pointer.  How can I obtain this object?

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" >
    	<Hub >
    		...
    		..
    		<HubSection IsHeaderInteractive="True" x:Name="hubSectionGridView"
    					DataContext="{Binding DefaultDataModel}"
    					d:DataContext="{Binding Groups[3], Source={d:DesignData Source=../NathsarTS.Shared/DataModel/SampleData.json, Type=data:SampleDataSource}}"
    					x:Uid="Section3Header" Header="Section 3" Padding="40,40,40,32">
    			<DataTemplate >
    				<GridView DataContext="{Binding Section3Items}" 
    					x:Name="itemGridView"
    					ItemsSource="{Binding Items}"
    					Margin="-9,-14,0,0"
    					AutomationProperties.AutomationId="ItemGridView"
    					AutomationProperties.Name="Items In Group"
    					ItemTemplate="{StaticResource Standard310x260ItemTemplate}"
    					SelectionMode="None"
    					IsSwipeEnabled="false"
    					IsItemClickEnabled="True">
    				</GridView>
    			</DataTemplate>
    		</HubSection>
    </Grid>

    Thanks!...


    Code is like a box of chocolates!...


    • Edited by VcDeveloper Sunday, September 21, 2014 7:24 AM
    Sunday, September 21, 2014 7:23 AM

Answers