1

このコードを実行するまで、ウィンドウ内のデータグリッドのサイズを変更できます。

    // Handle the tabcontrol animation 
DoubleAnimation dbTbViewsAnimation =
    new DoubleAnimation(dToTabHeightParameter, new Duration(new TimeSpan(0,0,1)));
this.tbViews.BeginAnimation(TabControl.HeightProperty, dbTbViewsAnimation);


// Handle the tabcontrol animation 
DoubleAnimation dbCurrentPlaylistHeightAnimation =
    new DoubleAnimation(dToCurrentPlaylistParameter, new Duration(new TimeSpan(0, 0, 1)));
this.dgCurrentPlaylist.BeginAnimation(DataGrid.HeightProperty, dbCurrentPlaylistHeightAnimation);

このコードの問題は何ですか? また、データグリッドのサイズ変更がブロックされるのはなぜですか? ありがとう!

4

1 に答える 1

0

Timeline.FillBehavior プロパティを参照してください。デフォルト値はHoldEndです。コンストラクターのオーバーロードを使用して、この動作を変更できます。

DoubleAnimation dbTbViewsAnimation =
    new DoubleAnimation(dToTabHeightParameter,
                        new Duration(new TimeSpan(0,0,1)),
                        FillBehavior.Stop);

参考:方法: ストーリーボードでアニメーション化した後にプロパティを設定する

于 2012-09-25T12:39:36.947 に答える