Cannet QAT serialize/deserialize MyCommand

Ribbon for WPF Forum

Posted 3 years ago by Yuka Esaki
Version: 16.1.0633
Avatar

Hi,

I want to QAT Serialize button with MyCommand that inherited System.Windows.Input.ICommand.
However, the following error occurs and can not be serialized.

Cannot serialize a nested public type 'MyApplication.CommandManager+OperatingCommandExecuter'.

Could you tell us the requirements of the command to QAT serialize?

For your reference, I show you StackTrace

 System.Windows.Markup.Primitives.MarkupWriter.VerifyTypeIsSerializable(Type type)
 System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope)
 System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope)
 System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope)
 System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope)
 System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item, Scope scope)
 System.Windows.Markup.Primitives.MarkupWriter.WriteItem(MarkupObject item)
 System.Windows.Markup.Primitives.MarkupWriter.SaveAsXml(XmlWriter writer, MarkupObject item)
 System.Windows.Markup.Primitives.MarkupWriter.SaveAsXml(XmlWriter writer, Object instance)
 System.Windows.Markup.XamlWriter.Save(Object obj, XmlWriter xmlWriter
 ActiproSoftware.Windows.Serialization.XamlSerializer.SaveToXmlWriter(XmlWriter writer, Object value)
 ActiproSoftware.Windows.Serialization.XamlSerializer.SaveToString(Object value)
 ActiproSoftware.Windows.Controls.Ribbon.Customization.RibbonControlPathList.#ztb()
 ActiproSoftware.Windows.Controls.Ribbon.Ribbon.SerializeQuickAccessToolBarItems()

Comments (1)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

We are using Microsoft's built-in XamlWriter to serialize things there.  They have some notes on limitations in the MSDN but it might not cover everything.  In this particular case, the error they give says the serializer can't handle serialization of nested types.  You'll need to unnest OperatingCommandExecuter to work around that.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.