This is a migrated thread and some comments may be shown as answers.

Unpinned pane: Trying to hook up MouseMove handler

4 Answers 34 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Charles Bates
Top achievements
Rank 1
Charles Bates asked on 07 Nov 2012, 04:44 PM
Hello,
Telerik.Windows.Controls.Docking.dll  v2.0.50727

We have a UserControl in a RadPane:
                            
<dock:RadPane x:Name = "tagPalettePane"
     Header = "Tag Palette" CanUserClose = "False"  = "180" ="{x:Null}" >
         <ScrollViewer VerticalScrollBarVisibility = "Auto">
             <Views:TagManagerView x:Name = "viewTagManager" />
         </ScrollViewer>
</dock:RadPane>

The TagManagerView contains an MS Toolkit  TreeView control; the TreeViewItems are described in a template:
<sdk:TreeView.ItemTemplate>
    <sdk:HierarchicalDataTemplate ItemsSource="{Binding Children}">
        <Border x:Name="TreeItemBorder"
            VerticalAlignment="Stretch"
            HorizontalAlignment="Stretch"
            MouseLeftButtonDown="TreeItemBorder_MouseLeftButtonDown"
            MouseLeftButtonUp="TreeItemBorder_MouseLeftButtonUp">
            <StackPanel Orientation="Horizontal">
                <CheckBox  IsChecked="{Binding IsVisible, Mode=TwoWay}"></CheckBox>
                <TextBlock x:Name = "TagTextBlock"  Text="{Binding Name}" Foreground="{Binding TagType, Converter={StaticResource colorConverter}}"
                            MouseEnter = "TagTextBlock_OnMouseEnter"
                            MouseLeave="TagTextBlock_MouseLeave"
                              />
            </StackPanel>
        </Border>
    </sdk:HierarchicalDataTemplate>
</sdk:TreeView.ItemTemplate>
TreeItemBorder_MouseLeftButtonDown hooks up a MouseMove event handler:
    LayoutRoot.MouseMove += DragTagDelta;
(LayoutRoot is a Grid control in our content display area.

Finally the question/problem:  
- When the RadPane is pinned open, the DragTagDelta handler is called.  
- When the RadPane is NOT pinned open, the code that hooks up the DragTagDelta handler is called, but DragTagDelta is never called.

Why is that, and how can I fix it?
Thanks for any insight...






4 Answers, 1 is accepted

Sort by
0
Charles Bates
Top achievements
Rank 1
answered on 07 Nov 2012, 08:14 PM
I have a VS2010 solution that demonstrates the problem, but can't find a way to attach it.  (Renaming the .zip as .png seemed to not work...)
0
Vladi
Telerik team
answered on 12 Nov 2012, 09:22 AM
Hello Charles,

It seems that there is an issue with the event binding in your project. When a RadPane is unpinned its content gets put in a ToolTip which may be causing your event handler not to be found.

The next code snippet shows how to call a UserControl event placed in a RadPane:
in the xaml of the MainPage:
<telerik:RadDocking>
    <telerik:RadSplitContainer>
        <telerik:RadPaneGroup>
            <telerik:RadPane Header="Pane 1">
                <local:MyUserControl/>
            </telerik:RadPane>
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
</telerik:RadDocking>

the xaml of custom UserControl:
<StackPanel x:Name="LayoutRoot" Orientation="Vertical" Background="White" MouseMove="LayoutRoot_MouseMove_1">
    ...
</StackPanel>

and in the code behind of the UserControl:
private void LayoutRoot_MouseMove_1(object sender, MouseEventArgs e)
{

}

On a side note you can only attach images in forum posts, attaching projects can be done in private support tickets only.

All the best,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Charles Bates
Top achievements
Rank 1
answered on 12 Nov 2012, 02:12 PM
Thanks for the reply,  However, we don't want to handle the MouseMove event on the UserControl, but on each TreeViewItem.  (The TreeViewItems are described in an ItemTemplate.)   We hook up the MouseMove event programmatically when the TreeItem_MouseLeftButtonDown event is handled.  
(Due to the unrelated controls involved, it is somewhat convoluted in getting a drag cursor hooked up and the MouseMove handler hooked up.)
Appreciate the help...
0
Vladi
Telerik team
answered on 15 Nov 2012, 09:06 AM
Hi Charles,

As we see that this is a somewhat complicated scenario which we cannot reproduce at our side could you open a support ticket and send us a runnable project that recreates the issue in order for us to assist you accordingly.

Other then that we cannot assist you if we cannot reproduce the issue on our side.

All the best,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Docking
Asked by
Charles Bates
Top achievements
Rank 1
Answers by
Charles Bates
Top achievements
Rank 1
Vladi
Telerik team
Share this question
or