Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Exception raising when Serialize ContextMenu

$
0
0

Hi Experts,

I tried to serialize ContextMenu of a Grid control by using the following code.

XmlSerializer  serialiser=new XmlSerializer(typeof(ContextMenu));
XmlWriter writer=XmlWriter.Create("ContextMenu.xml");
serialiser.Serialize(writer,grid.ContextMenu);

But i  am getting the following exception.

Exception:

"There was an error reflecting property 'InputBindings'.

Inner Exception:

Cannot serialize member 'System.Windows.Input.InputBinding.Command' of type 'System.Windows.Input.ICommand', see inner exception for more details.

Please advice me, whats my wrong here also let me know is it possible to serialize/de serialize ContextMenu.


-Ramesh


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>