using System.Windows.Media.Animation;\r
using System.Windows.Media.Imaging;\r
using System.Windows.Shapes;\r
+using System.Windows.Browser;\r
\r
\r
\r
api_canvas.MouseWheel += Mouse.Canvas_MouseWheel;\r
panel.KeyDown += Keyboard.Canvas_KeyDown;\r
panel.KeyUp += Keyboard.Canvas_KeyUp;\r
+\r
+ HtmlElement htmlHost = HtmlPage.Document.GetElementById("silverlightControlHost");\r
+ //if (htmlHost != null) HtmlPage.Window.Alert("silverlightControlHost is null");\r
+ htmlHost.SetStyleAttribute("width", (200+wid).ToString()+"px");\r
+ htmlHost.SetStyleAttribute("height", (20+hei).ToString() + "px");\r
+ htmlHost.SetStyleAttribute("margin", "2em auto auto auto");\r
}\r
\r
#endregion\r
if (nextIntervalFrame <= 0)\r
{\r
var tmp = new System.Windows.Controls.Canvas();\r
- foreach (Internal.PrimitiveFigure f in stack)\r
+ if (stack.Count > 0)\r
{\r
- tmp.Children.Add(f.toNative());\r
+ foreach (Internal.PrimitiveFigure f in stack)\r
+ {\r
+ tmp.Children.Add(f.toNative());\r
+ }\r
}\r
api_canvas.Children.Clear();\r
api_canvas.Children.Add(tmp);\r