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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:14:52+00:00 2026-05-14T15:14:52+00:00

I am using the Visifire charts to display data on a Windows Phone 7

  • 0

I am using the Visifire charts to display data on a Windows Phone 7 application.
I created a chart that was properly bound to a dependency property. It worked great. I decided to make the chart into a user control, since I was going to use it in another project as well with the same setup. Now my databinding doesn’t work unless I bind it in the code behind rather than in the XAML.

here’s what I have:

<UserControl ... x:Name="root">
 ...
     <chart:DataSeries ... DataSource="{Binding ElementName=root, Path=Results}">
 ...
</UserControl>

and the code behind:

public MyList Results
{
    get { return (MyList)GetValue(ResultsProperty); }
    set { SetValue(ResultsProperty, value); }
}

    // Using a DependencyProperty as the backing store for Results.  This enables animation, styling, binding, etc...
    public static readonly DependencyProperty ResultsProperty =
        DependencyProperty.Register("Results", typeof(MyList), typeof(MyChart), new PropertyMetadata(null));


public GoogleChart()
{
    Loaded += delegate
    {
    //  theChart.Series[0].DataSource = Results;
    };
    Results = new GoogleResults();
    InitializeComponent();
}

If I uncomment the line theChart.Series[0].DataSource = Results; it works perfectly. But if I leave that line commented (like I had before I moved the chart to the UserControl) it doesn’t bind. (By the way: theChart is the x:name of the parent of the chart. So the first element, .Series[0], references to the chart).

Does anyone know why this would happen? Again, it worked great until I moved the code to a UserControl.

Thanks

  • 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-14T15:14:53+00:00Added an answer on May 14, 2026 at 3:14 pm

    If I’m understanding you correctly you’ve created this UserControl so that you can place instances of it into various pages in your app.

    In that case you are likely to be giving those instances a name. That name will replace the name “Root” that is initially assigned in the UserControl’s Xaml. Hence the binding for ElementName=Root will fail.

    Typically there is a root element (normally a Grid) with the name “LayoutRoot”. Hence instead of relying on the UserControl name which can change use “LayoutRoot” which by convention is the Content element for the UserControl. Like so:-

    <chart:DataSeries ... DataSource="{Binding ElementName=LayoutRoot, Path=Parent.Results}">
    

    Note the property path now starts with Parent which takes you up to the UserControl without actually needing to know the UserControl’s name.

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

Sidebar

Related Questions

I am developing one chart application on .net framework by using Silverlight and Visifire,
I created a pie chart using visifire in silverlight. Is there a way to
I'm using Visifire. I have plotted about 500+ points on a line chart. However,
Using Android TelephonyManager an application can obtain the state of data activity over the
Using Entity Framework CodeFirst, how do I create a created datetime column that gets
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using C#, I need a class called User that has a username, password, active
Using MVC2 I have an AJAX form which is posting to a bound model.

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.