Page view counter
Converted project (from Beta 1 to Beta 2) is not working.
Last post 10-10-2008 3:40 AM by Amanda Wang - MSFT. 1 replies.
Sort Posts:
10-08-2008 2:20 AM
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

mramu1310

Loading...
Joined on 10-08-2008
Posts 1
10-10-2008 3:40 AM
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.

 

Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support

Amanda Wang - MSFT

Loading...
Joined on 04-30-2007
Posts 225
Microsoft Communities