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