Problem loading Page.xaml

Jan 28, 2009 at 3:05 PM
Edited Jan 28, 2009 at 3:07 PM
Let me preface this be stating I am a 100% newbie to Silverlight so this problem is probably on my end.

I was looking at project using blend and when I tried to open the Page.xaml file, I would get an error stating that it was unable to create an instance.  I attached VS debugger and found the problem was in ScrollHelper.cs.  Using some helpful hints I found through "The Google" :)  I made a small change to the code.  After compiling the code, shutting down Blend and reopening it, I was able to open page.xaml.

The change I made to ScrollHelper was to check if the HtmlPage was enabled.  Apparently there is an issue with this if you are in design mode.

Original code:

 HtmlPage.Window.AttachEvent("DOMMouseScroll", OnMouseWheelTurned); 
 
HtmlPage.Window.AttachEvent("onmousewheel", OnMouseWheelTurned); 
 
HtmlPage.Document.AttachEvent("onmousewheel", OnMouseWheelTurned);

 

New Code

if
(HtmlPage.IsEnabled) 
 {
    
HtmlPage.Window.AttachEvent("DOMMouseScroll", OnMouseWheelTurned); 
    
HtmlPage.Window.AttachEvent("onmousewheel", OnMouseWheelTurned); 
    
HtmlPage.Document.AttachEvent("onmousewheel", OnMouseWheelTurned); 
}

 

 

Not sure if this was the correct solution.  Still learning here....