2

Please, help me:

If I have a TextBox in a HubSection, how I can get data from it if the Grid that I have the TextBox is in a DataTemplate?,

<Hub Style="{StaticResource HubStyle1}">
    <Hub.Header>
    <!-- Some stuff here -->
    </Hub.Header>

    <HubSection Width="731" Style="{StaticResource HubSectionStyle1}">
       <DataTemplate>
           <Grid  FlowDirection="RightToLeft" Margin=" 0,10,0,0" >

               <TextBox  
                   Grid.Row="0" 
                   Grid.Column="1"     
                   Style="{StaticResource AddTextBlockStyle}"    />

           </Grid>
       </DataTemplate>
    </HubSection>
</Hub>
Eric Schmidt
  • 312
  • 1
  • 11

2 Answers2

4

handle the Loaded event for any of the elements and the sender parameter will be that element. Save the parameter for later access.

Michael S. Scherotter
  • 10,715
  • 3
  • 34
  • 57
0

Go through This question How do I access a control inside a XAML DataTemplate

if you are trying to acccess element inside template

Community
  • 1
  • 1
uncia
  • 594
  • 2
  • 6
  • 16