Hi,
In my SL app I've got to show both HTML and SL controls in the same container (but not at the same time).
My first take was to have a ContentControl and stick the SL control or HtmlViewer control inside whenever I want it. This works perfectly fine for SL controls but for the HtmlViewer there is a bit of initialization time. That means that as I make the HtmlViewer available I cannot access its elements through the DOM.
My solution was to have 2 containers within a Grid, the HtmlViewer and a ContentControl. If there's no content in the ContentControl, then the HtmlVIewer is seen, if there's some content in the ContentControl then the HtmlVIewer is hidden.
That works great in IE but FF insists on always sticking the HtmlViewer on top. THe ContentControl is visible but behind the Html so it can't be clicked.
Any idea how I could get around that?
Attached is a test project. Run it and click on the "show html" and "show control" buttons.
The right-hand side displays the correct content. In IE it works as expected (right-click on the red area and you see the SL context menu). Do the same in FF and right-click on the red area and you can see the HTML context menu.
Hello,
First of all, I can say that your way of using the XamHtmlViewer is not the standard one.
If I had to create an SL application with XamHtmlViewer, I wouldn't use your approach.
I think you'd better use the SourceUri property instead using an additional IFRAME element.
Also you have to change the Visiblity property of the XamHtmlViewer in order to hide/show to control.
Just removing all children from your custom IFRAME is not enough.
I just added Visiblity= Visible/Collapsed to your code and it works fine under Firefox now.
Regards,
Doychin Dochev