Is it possible to convert a System.Windows.Documents.Block
to System.Windows.UIElement
?
I need this as I want to add the blocks I created to a fixed document. Is there a开发者_开发百科ny other way?
For if someone still needs to know this, it's pretty easy.
Just use a BlockUIElement to contain the UIElement.
For instance, if you were to attach a Border element to a table's cell:
TableCell cell = new TableCell(new Border()); //won't work!
TableCell cell = new TableCell(new BlockUIContainer(new Border())); OK!
精彩评论