Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7765397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:09:26+00:00 2026-06-01T15:09:26+00:00

Trying to rewrite machine generated my first ever WP7 HelloWorld into something more sophisticated.

  • 0

Trying to rewrite machine generated my first ever WP7 HelloWorld into something more sophisticated.

Just can’t understand how to get reference to objects? For instance in my layout there are several objects:

    <!--TitlePanel contains the name of the application and page title-->
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
        <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
        <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Loaded="onLoaded"/>
    </StackPanel>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"></Grid>
</Grid>

Simply I want to have programmatic reference to TextBlock‘s. For sure it should be something very simple and obvious, but I can’t find way to that.

Please give me some hint!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T15:09:27+00:00Added an answer on June 1, 2026 at 3:09 pm

    barmaley,

    If you want to reference a control in code, you must ensure that your xaml control has its name parameter set, so for instance

    <TextBlock Text="Hello World"/>
    

    you would not be able to access that textblock very easily from the code behind, so instead you should give it a name

    <TextBlock Text="Hello World" x:Name="helloWorldText"/>
    

    therefore in your code behind you can reference this control using

    helloWorldText.text = "something";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying rewrite xCmd which can start a process on a remote machine. Basically
I'm trying to rewrite some old SQL into LINQ to SQL. I have a
Im trying to rewrite something ive written in Visual Basic that uses an XMLHTTP
I'm trying to implement a new ReWrite rule on my local dev machine. I
I'm trying to rewrite this url: http://www.example.com/user.php?user=username into http://example.com/username I'm using this code in
I'm trying to rewrite search results page url to something like /search/query-1.html but when
I am trying to rewrite a VB function into C#, but I'm getting the
I'm trying to rewrite the following URL test.php?par1=foo&par2=bar Into... newtest.php?hidden_par=blah&par1=foo&par2=bar I have this rule,
I'm trying to rewrite the following into htaccess using - redirect 301 redirect mysite.com/longname/{20
I am trying to rewrite in htaccess mobile.domain.com/mobile/function into mobile.domain.com/function I thought the below

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.