3

WPF GridSplitter の使用中に奇妙な動作が発生しています。

適切な Horizo​​ntalAlignment プロパティをストレッチに設定しており、サイズを変更すると GridSplitter が飛び回り、元の位置に戻ったり、ドラッグすると飛び跳ねたりすることもあります.....

他の誰かがこれを引き起こしている可能性があることを見たり知っていますか?

ありがとう

ここにXAMLがあります

<GridSplitter x:Name="grdTreeSplitter" Grid.Row ="1" 
     BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" 
     BorderThickness="1"
     HorizontalAlignment="Stretch" Panel.ZIndex="0" 
     ResizeBehavior="PreviousAndNext" ResizeDirection="Rows"
     SnapsToDevicePixels="False" ShowsPreview="False" UseLayoutRounding="False"
     DragIncrement="1"
     DragDelta="grdSideExplorerSplitter_DragDelta">
  <GridSplitter.Visibility>
    <MultiBinding 
      ......
    </MultiBinding>
  </GridSplitter.Visibility>
</GridSplitter>
4

4 に答える 4

6

私は同じ問題を抱えていて、同じコードがWPFで壊れている間、Silverlightで正常に機能することを発見したので、WPFの問題である可能性があると思います。私の修正は、自分のバージョンのGridSplitterを公開することでした。これは大きすぎてここに配置できないため、ブログで確認できます。

于 2011-12-12T06:32:18.110 に答える
2

I have the same problem it seems like we are drawing a lot of stuff. And if we have the ShowsPreview property set. The user can drag outside the grab-handle while it is trying to update the screen. But the user thread is supposed to be separate from the graphic rendering thread so I don't know. If the user selects the splitter and uses the up and down arrows on the keyboard it works fine also. Ah whilst writing this. I tried using larger values for dragincrement and that seems to work also. Better solution. This is with two gridsplitters in the same direction(three sections of screen) I don't know if that is also your setup.

于 2010-08-15T17:14:03.753 に答える
1

これは古いと思いますが、おそらくこれは誰かを助けるでしょう。スプリッターが素早く移動した後、スプリッターが元の位置に戻るという問題がありました。私にとっての解決策はCancelDrag、スプリッターのPreviewMouseUpイベント ハンドラーを呼び出すことでした。

警告

これは、他の人を助けるかもしれないし、助けないかもしれません。私は、追加機能 (自分の動きの管理を含む) を備えた大幅に変更された派生クラスを使用しており、単純なシナリオで役立つ (またはまったく機能する) かどうかはわかりません。

于 2014-10-17T20:42:07.660 に答える
0

グリッド列に width="1*" があると、グリッドスプリッターがジャンプしていました。サイズをピクセル単位で設定したところ、ジャンプが停止しました。

于 2014-05-24T08:42:20.883 に答える