简体   繁体   English

在Metro Style App中从父框架访问源页面中的TextBlock控件

[英]Access TextBlock Control in Source Page From Parent Frame in Metro Style App

My Source Page 我的资料页

<Grid>   
    <TextBlock x:Name="TbHeader"/>
    <Frame x:Name="FrmPages" d:IsLocked="True"/>
</Grid>

My Source Page Codes 我的源页面代码

  protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            FrmPages.Navigate(typeof(Categories));
        }

This my parent Categories page codes 这是我父母的类别页面代码

protected override void OnNavigatedTo(NavigationEventArgs e)
{
    //??? How can I change TbHeader.Text?
}

Thank you very much. 非常感谢你。

If I get your question correctly you are trying to change values in an XAML page that isn't being shown at the moment. 如果我正确地提出了您的问题,则您正在尝试更改当前未显示的XAML页面中的值。 If that's the case it doesn't really make sense. 如果是这样的话,那根本就没有意义。

If you would like to send data from a page to another depending on user input, you can use Navigate to send parameters, see this tutorial . 如果要根据用户输入将数据从页面发送到另一个页面,可以使用导航来发送参数,请参阅本教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM