【问题标题】:Access Data Inside HubSection访问 HubSection 内的数据
【发布时间】:2013-12-30 20:15:29
【问题描述】:

请帮帮我:

如果我在 HubSection 中有一个 TextBox,如果我拥有 TextBox 的 Grid 在 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>

【问题讨论】:

    标签: c# xaml windows-8.1


    【解决方案1】:

    处理任何元素的Loaded 事件,sender 参数将是该元素。保存参数以供以后访问。

    【讨论】:

      【解决方案2】:

      完成这个问题 How do I access a control inside a XAML DataTemplate

      如果您尝试访问模板内的元素

      【讨论】:

        猜你喜欢
        • 2017-03-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-02-28
        • 2014-04-03
        相关资源
        最近更新 更多