Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
795
persistence problems with context menus
posted

Using the approach outlined at:

http://forums.infragistics.com/blogs/devin_rader/archive/2011/04/15/extending-xamgrid-with-a-right-click-context-menu.aspx

with 2011.1, there does seem to be a problem with this and your persistence framework.  When I load the xamgridex from isolated storage, the context menu shows up ok, but the events don't work.  If I don't use your persistence mechanism and just construct the xamgridex normally (i.e. don't call PersistenceManager.Load) the click events for the menu items of course work as expected.

Does anyone have any ideas on how to work around this and make events work when using persistence manager?

Parents
No Data
Reply
  • 40030
    Offline posted

    HI, 

    The persistence framework can't save everything:

    http://help.infragistics.com/NetAdvantage/Silverlight/2011/1/CLR4.0/?page=Persistence_About_Infragistics_Control_Persistence_Framework.html

    There are some types of properties that are not saved by the Infragistics Control Persistence Framework. It does not save AttachedProperties, DataTemplates, Paths, ControlTemplates, Styles, and ItemPanelTemplates. However, if you needed to save such properties, you can use the Identifierattached property off the PersistenceManager. Other types that the framework does not save are the Cursor, FontWeight, FontFamily and FontStyle. You can however save these by using a custom TypeConverter. 

    This actually also includes events. So if you're placing a Clicked event on the menu, and that menu is being restored through persistence, it will lose its events. As the menu would have been re-created and thus the events would not have been loaded on it. 

    You'd be better off, hooking up the event in code to the ContextMenu when it's set, and exposing the Click event off of the xamGrid. 

    -SteveZ

Children