public void Save( CanvasContent content, string file )
 {
     using ( var writer = new StreamWriter( file ) )
     {
         var serializer = new CanvasXmlWriter( writer );
         serializer.Location = Path.GetDirectoryName( file );
         serializer.Serialize( content );
     }
 }
        public void CopyToClipboard( CanvasContent content )
        {
            using ( var writer = new StringWriter() )
            {
                var settings = new SerializationSettings();
                settings.RewriteIds = true;

                var serializer = new CanvasXmlWriter( writer, settings );
                serializer.Serialize( content );

                Clipboard.Clear();
                Clipboard.SetData( DataFormats.Xaml, writer.ToString() );
            }
        }