I have a Silverlight full screen/frame app that I am building as a new chrome for an existing asp.net app. New stuff is being built in SL however, we still want to use the old pages.
I am using the navigation framework with the xamMenu. I am using a drop down menu. It works fine.
In order to also use the .aspx pages I have created a SL page with the HtmlView control in it. I have UrlMappings that call the HtmlViewer page and pass it in the .aspx page URL and in the codebehind set that URL to HtmlViewer.
So... all the above works fine... my problem is this... When the HtmlViewer page is in the menuFrame the drop down menus are cut off right at the location where the HtmlViewer controls top is.
I assume this is because the HtmlViewer control punches a hole in the SL app so you can view whats on the browser and the browser doesn't draw the SL menu.
My question is, how can I solve this. My fear is the only way to do it is to put some type of event/commanding/trigger/whatever so that if the HtmlViewer is in the navigation frame it is disabled or visiblity set to collapsed. I have not even tried this though.
Has anyone run into this or have an idea how I can make the SL menus draw/show on top of the HtmlViewer control that is in my navigation frame?
Thanks,
BOb
(I wasn't sure if I should put this in the xamMenu section of the HtmlViewer section).
The XamHtmlViewer does not actually "punch a hole" in your app. Quite the opposite, it overlays a standard <DIV> element on top of the Silverlight plugin, which is why you also have to have the plugins Windowless attribute set to true in order for the control to work.
Silverlight has no way to natively render HTML, and no way to embed a web browser control as a UI Element in non-out-of-browser applications, so this is really the only way to simulate showing HTML content in a Silverlight app.
Because the <DIV> always has a higher z-index than the plugin, you end up seeing the clipping behavior. Unfortunatly there is no way to avoid it, short of the methods you mention, hiding the XamHtmlViewer when you detect the menu is open.
Devin
OK, I'm trying to get this working here. I am trying with a ChangePropertyAction behavior on MouseEnter/Mouse leave to make the frame non-visible. The problem is when move the mouse to the dropdown the MouseLeave of xamMenu fires and the frame becomes visible and cuts off the drop downs.
Seems crazy to put a behavior on every menu item.
Is there an event of xamMenu that fires when a pull down menu opens and then one when it closes?
I see the Drop event... is that what I need. Is there an undrop or close event? I don't see one listed.
Hello Bob,
The best events to use are the SubmenuOpened and SubmenuClosed events off of the XamMenuItem object. You should be able to create a generic event handler for each of these and then have each of the top level menu items use these handlers.
The Drop event is an event that is inherited from Silverlight's UIElement class and is used for drag and drop logic. For more information about this event please see the following MSDN article:
<http://msdn.microsoft.com/en-us/library/system.windows.uielement.drop(VS.95).aspx>
If you would like, I could also log a feature request on your behalf to have a event on the XamMenu itself that fires when a XamMenuItem is expanded.
Please let me know if you have any further questions or concerns about this matter.
Jason,
That sounds workable, however, how do I attach the event to each item? I hope to databind to the menu, either to a viewmodel object or a RIA Service Entity. Would I have to just loop through each menu item after the bind occurs and attach a handler to the event.
Yes... please request events for this on the xamMenu... of course I doubt this will be added before I need to get it working.
Is there any state property on xamMenu that I can check to see if a menu is open or not? Perhaps I can check that on the click? Of course, seems like once again I would have to attach a handler to every xamMenuItem.
I am going to log a new feature request on your behalf for menu opening and closing events off of the parent menu. I'll be opening a private case for you which I will use to provide more information about the feature request.
Yes, his method worked all. Although, It would still be nice to not have to attach to the event of every menu item. But, I guess it's not to bad to just loop through them and add the handler.
I actually set the frame's visibility to collapsed. Unfortunately I can use opacity and fade it in and out
I see that Georgi has assisted you with the issue of wiring up the click events through the forum thread:
<http://forums.infragistics.com/forums/t/46289.aspx>
Does using this approach allow you to implement the behavior to hide the XamHtmlViewer? Please let me know if you have any further questions or concerns about this matter.