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 5841691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:55:20+00:00 2026-05-22T11:55:20+00:00

I have a silverlight user control which is bound to a Document object. the

  • 0

I have a silverlight user control which is “bound” to a Document object. the document class contains an array of Field objects. The intention is that when the control is bound to a document, each field in the document is bound to a control in the user control. Each field has a name and the control in the user control that is to be bound to that field is given the same name (so if the field is called “FirstName” there will be a text box in the user control with x:Name=”FirstName”). In order to determine which control is to be bound to which field i used the following code:

private void BindDocumentToUserControl(Document document)
{
    foreach (Field field in document.Fields)
    {
        Control c = this.FindName(field.Name);

        if (c != null)
        {
            //bind control to field...
        }
    }
}

this all works fine until i try to put the controls into a tab control. when the user control is first loads (and the user has not changed the selected tab themselves) then the above method finds all of the controls. however, if the user changes the selected tab and then re-binds the control, this.FindName will only find the controls that are in the selected tab. if i pass the name of a control in a different tab that i know is correct it will still return null.

i found the article below regarding the same issue however the solution is not really apporiate for what i’m trying to do. any help would be greatly appreciated

http://forums.silverlight.net/forums/p/59912/248977.aspx

  • 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-05-22T11:55:21+00:00Added an answer on May 22, 2026 at 11:55 am

    As a bit of a hack of an answer, couldn’t you load the controls for each tab to a hidden panel, one tab at a time, then once the controls are loaded, move them back into the tab?

    I can’t say this definitely works, but it sounds “logical”, if a bit of a dirty hack….

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user control in silverlight which contains both XMAL and .cs file.
I have a data navigation user control in Silverlight which opens a child window
I have a Silverlight DataGrid that contains a single template column which displays a
I have a Silverlight user control that has an Image control within it. This
I have a Silverlight application that is built from a set of Silverlight class
I have a silverlight control which has a reference to a silverlight enabled wcf
I have a Silverlight control that tries to have the same background as the
A while back I wrote a silverlight user control which had a csv import/export
I have created a Silverlight User Control. The markup is: <StackPanel Grid.Row=4 Grid.Column=0 Orientation=Horizontal
If I have a usercontrol (in Silverlight) that I've written, that uses XAML to

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.