WPF GridSplitter [英] WPF GridSplitter

查看:116
本文介绍了WPF GridSplitter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用WPF GridSplitter时出现奇怪的行为.

I am experiencing weird behaviour whilst using the WPF GridSplitter.

我将适当的Horizo​​ntalAlignment属性设置为可拉伸,并且当我调整它们的大小时,GridSplitter会跳来跳去,有时会回到其原始位置,或者只是在拖动它们时跳来跳去.....

I have the appropriate HorizontalAlignment properties set to stretch and when I resize them the GridSplitter jumps around, sometimes going back to their original positions or just jumping around as I drag them.....

有没有其他人看到或知道是什么原因造成的?

Does anyone else seen or know what may be causing this?

谢谢

这是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>

推荐答案

我遇到了同样的问题,并且发现相同的代码在WPF中损坏时在Silverlight中可以正常工作,因此我认为WPF可能是一个问题.我的解决方法是推出自己的GridSplitter版本,该版本太大了,无法在此处放置,因此您可以在

I had the same problem and found the same code works fine in Silverlight while it is broken in WPF, so I think it might be a problem with WPF. My fix was to roll out my own version of the GridSplitter, which is too big to put here, so you can see it on my blog.

这篇关于WPF GridSplitter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆