Silverlight XAML Binary Serialization

I am working on a Silverlight application that should display complex 2d vector graphics. It downloads the zamp XAML file from the server, analyzes it (XamlRead) and enters the root directory on the page. This is great for small xaml files. The problem is that I need to make it work with a much larger file (it has more content). For example, one of my uncompressed xaml files is 20 MB in size, and the XamlRead method uses a tool to parse it. My question is, is there a way to do all the parsing on the server side. It’s best to just save the serialized binary output of the XamlRead method as a BLOB in the database. However, when I try to serialize it, I get a message saying that "the Canvas object is not marked as serializable." I would really appreciate any advice.

+3
source share
3 answers

Silverlight does not have built-in binary serialization; however, protobuf-net runs on Silverlight and can help bridge that gap. In the current assembly, you can only actually serialize the types that you control (due to adding attributes) - however, in the middle of a lot of refactoring (among other things), I add support for serializing types without attributes.

I expect it to be another 2 weeks before it is available as a stable build (hopefully) stable, but you can take a look at it then.

, (, , ), .

, ( " " ) , . . ( .NET, Silverlight)

+2

, SharpSerializer Silverlight: http://www.sharpserializer.com/en/index.html. Serializable, .

+1
0

Source: https://habr.com/ru/post/1706003/


All Articles