0

テーブルを時計回りに最大90度回転させる必要があります。これは、FlowDocumentのブロックの1つです。テーブルにある種の回転を適用する方法はありますか?
次のようなTextEffectを作成するための可能な解決策:


var table = new Table();   
 ... // fill the table here
var effect = new TextEffect  
                 {
                     Transform = new RotationTransform(90),
                     PositionStart = 0,
                     PositionCount = int.MaxValue
                 };
table.TextEffects = new TextEffectCollection();
table.TextEffects.Add(effect);

動作しません。

4

1 に答える 1

0

このように解決:
テーブルを回転させる代わりに、それをコンテナに入れて回転させます。

var container = new BlockUIContainer
                          {
                              Padding = new System.Windows.Thickness(0),
                              Margin = new System.Windows.Thickness(0) 
                          };
var scrollViewer = new FlowDocumentScrollViewer
                       {
                           VerticalScrollBarVisibility = ScrollBarVisibility.Hidden,
                           LayoutTransform = new RotateTransform(90)
                       };
container.Child = scrollViewer;
var tableDocument = new FlowDocument { PagePadding = new System.Windows.Thickness(0) };
// here the table is created
var table = operationStagesControl2.ConvertToXaml();
// adding table to document
tableDocument.Blocks.Add(table);
// hosting scroll viewer gets document
scrollViewer.Document = tableDocument;
// and in the end we have container with rotated table inside it
于 2010-05-11T11:00:38.270 に答える