ToolWindow Active with ScrollBar

Docking/MDI for WPF Forum

Posted 6 years ago by Raoul Ruan
Version: 13.2.0591
Avatar

When I click in a ToolWindow(anywhere),the ToolWindow will be actived and change the current layout to show itself completely,however ,I do not want it to do so.Then how can I solve it?

Comments (4)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, can you tell us exactly how to repro what you see from within our samples?  Sorry but I'm not quite sure what you are referring to.  Thanks!


Actipro Software Support

Posted 5 years ago by Raoul Ruan
Avatar
<Window x:Class="ScrollBarWithActiPro.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:docking="http://schemas.actiprosoftware.com/winfx/xaml/docking"
        Title="MainWindow" Height="150">
    <StackPanel>
        <ScrollViewer Height="100">
                <docking:DockSite
                    CanToolWindowsAttach="False"
                    CanToolWindowsRaft="False"
                    CanToolWindowsClose="False"
                    CanToolWindowsAutoHide="False"
                    ToolWindowsHaveTitleBars="False"
                    ToolWindowsHaveOptions="False"
                    Height="300"
                    >
                    <docking:SplitContainer Orientation="Vertical">
                        <docking:ToolWindowContainer>
                            <docking:ToolWindow>
                                <Rectangle Height="100"></Rectangle>
                            </docking:ToolWindow>
                        </docking:ToolWindowContainer>
                        <docking:ToolWindowContainer>
                            <docking:ToolWindow>
                            <Rectangle Height="100" Fill="Black"></Rectangle>
                        </docking:ToolWindow>
                        </docking:ToolWindowContainer>
                        <docking:ToolWindowContainer>
                            <docking:ToolWindow>
                            <Rectangle Height="100" Fill="Red"></Rectangle>
                        </docking:ToolWindow>
                        </docking:ToolWindowContainer>
                    </docking:SplitContainer>
                </docking:DockSite>
        </ScrollViewer>
    </StackPanel>
</Window>

 

When the screen is half white rectangle and half black rectangle , you click the black , then , the black rectangle [ToolWindow.Active()] event will be raised , and the scroll bar will scroll , and the position of the black rectangle will move above.

It's not correct.So can you help me solve it?

Answer - Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello, it seems like the problem here is described pretty well in this StackOverflow post:

http://stackoverflow.com/questions/8384237/stop-wpf-scrollviewer-automatically-scrolling-to-perceived-content

Basically you'd need to handle the RequestBringIntoView event somewhere before the ScrollViewer gets it.  So add a handler to DockSite.RequestBringIntoView and set e.Handled there.  I think that will do the trick.


Actipro Software Support

Posted 5 years ago by Raoul Ruan
Avatar

It works ~ thanks

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.