UIItem for GridSplitter

Sep 14, 2010 at 9:14 PM

What is the right UIItem for WPF GridSplitter and how can I simulate a drag?

Sep 14, 2010 at 11:03 PM
Edited Sep 14, 2010 at 11:03 PM

It seems that it should be Thumb. This is what I have so far:

var t = w.Get<Thumb>("splitter");

I am assuming that since t is not null, I actually did find the correct item and that Thumb is the correct type for it. But doing the SlideHorizontal does not yield the desired result. Instead a different (adjacent) button gets clicked. This is ym Testwindow:


<Window x:Class="WhiteTest.ApplicationUnderTest.MainWindow"
        Title="WindowUnderTest" Height="350" Width="525">
            <ColumnDefinition Width="262*" />
            <ColumnDefinition Width="241*" />
        <Button AutomationProperties.AutomationId="buttonOne" Click="ButtonOneOnClick">Click me!</Button>
        <GridSplitter AutomationProperties.AutomationId="splitter" HorizontalAlignment="Right" Width="10"></GridSplitter>
        <Button AutomationProperties.AutomationId="buttonTwo" Click="ButtonTwoOnClick" Grid.Column="1">Click me too!</Button>