Skip to main content

Microsoft Silverlight

Unanswered Question Converted project (from Beta 1 to Beta 2) is not working.RSS Feed

(0)

mramu1310
mramu1310

Member

Member

0 points

1 Posts

Converted project (from Beta 1 to Beta 2) is not working.

Hi,

I am new to Silverlight.

One of my friend gave me code for Pie chart which was coded in VS 2008 and Silverlight 2.0 Beta1.

I converted it to Silverlight 2.0 Beta 2.

In order to rectify compilation errors I did the following modifications.

a) Changed the statement

myCanvas = this.InitializeFromXaml(new System.IO.StreamReader(s).ReadToEnd()) as Canvas;

to

myCanvas = XamlReader.Load(new System.IO.StreamReader(s).ReadToEnd()) as Canvas;

b) Removed Boolean parameter in XamlReader.Load method.

With the above two modifications the compilation errors were rectified.

 

when I ran the project i got the runtime error in the following statement

pathElem.SetValue(Path.DataProperty, sbuilder);

I changed this statement to

System.Windows.Shapes.Path path1 = (System.Windows.Shapes.Path)XamlReader.Load("<Path " +

"xmlns=\"http://schemas.microsoft.com/client/2007\" " +

"Data=\"" + sbuilder.ToString() + "\"/>");

var o = path1.GetValue(System.Windows.Shapes.Path.DataProperty);

path1.Data = null;

pathElem.SetValue(System.Windows.Shapes.Path.DataProperty, o);

 

Then my project is running with out any errors but it is not showing the Pie chart. Am I missing anything?

Are there any setting to set to run a beta 1 project in Beta 2? Please help me.

 Thanks in Advance.

 

Thanks and Regards

Ramu

Amanda Wang - MSFT
Amanda W...

All-Star

All-Star

17234 points

1,466 Posts

Re: Converted project (from Beta 1 to Beta 2) is not working.

Hi,

mramu1310:
Then my project is running with out any errors but it is not showing the Pie chart. Am I missing anything?

Based on the code that you can see, you declare the System.Windows.Shapes.Path path1, do you want to display the pie chat by using path1?

You need to add the path1 to the usercontrol. for example:

  LayoutRoot.Children.Add(path1);

If I mmisunderstand you, please let me know.

 

Amanda Wang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities