Показаны сообщения с ярлыком wpf. Показать все сообщения
Показаны сообщения с ярлыком wpf. Показать все сообщения

пятница, 12 ноября 2010 г.

XamlWriter.Save throws exception when trying to serialize empty ObservableCollection

I've encountered this exception, when tried to serialize empty ObservableCollection. Non-empty collection was serialized smoothly.

To fix it, create a wrapper class.

public class StringObservableCollection : ObservableCollection<string>
{
}

// ... 
var collection = new StringObservableCollection();
System.Windows.Markup.XamlWriter.Save(collection);

среда, 27 октября 2010 г.

TO DON'T: Do not ever think of writing WYSIWYG visual editor on WPF RichTextBox and FlowDocument base

It's gonna be a pain in the ass.
FlowDocument has very limited capabilities for visual editing. It's gonna be a pain to:
— Insert an image
— Make an image resizable
— Serialize, copy-paste images
— Modify table's width directly, horizontal or vertical alignment
— Modify table column's width and table cell height
— Implement a robust algorithm of table cells merging
... I'm sure this list can be continued.

Just remember to think twice before considering this idea as a good one