Home Forums WPF controls Xceed Toolkit Plus for WPF Prevent LayoutAutoHideWindowControl opening by mouse over event

Mots-clés : 

4 sujets de 1 à 4 (sur un total de 4)
  • Auteur
    Messages
  • Marco83
    Participant
    Post count: 6
    #44141 |

    I’m trying to handle mouse over event in order not to open LayoutAutoHideWindowControl automatically. This happen when I put mouse cursor over « Connection Manager » label (please refer to attached picture). My goal should be opening LayoutAutoHideWindowControl only by clicking on « Connection Manager » label.
    Could you provide a snippet of code in which you show how to handle this scenario?

    Thank you.

    http://s11.postimg.org/kpubi95ur/Capture_xceed.pngAvalonDock autohide window

    Marco83
    Participant
    Post count: 6

    Any moderators could confirm if the following change (the lines commented out) has no side effects on other controls? It seems to me to get the expected behavior.

    Thank you.

    protected override void OnMouseEnter(System.Windows.Input.MouseEventArgs e)
            {
                base.OnMouseEnter(e);
    
                // Force opening window by clicking
                LayoutAnchorControl currentLayoutAnchorControl = e.Source as LayoutAnchorControl;
                var model = currentLayoutAnchorControl.Model as LayoutAnchorable;
                if (model.IsAutoHidden)
                    e.Handled = true;
    
                if (!e.Handled)
                {
                    _openUpTimer = new DispatcherTimer(DispatcherPriority.ApplicationIdle);
                    _openUpTimer.Interval = TimeSpan.FromMilliseconds(400);
                    _openUpTimer.Tick += new EventHandler(_openUpTimer_Tick);
                    _openUpTimer.Start();
                }
            }
    Fawzi [Xceed]
    Membre
    Post count: 722

    Hi,

    You may go in file Xceed.Wpf.AvalonDock/Controls/LayoutAnchorControl.cs,
    and completely remove the override method « OnMouseEnter ».

    This method adds a timer to show the LayoutAnchorable in 400ms. Removing the « OnMouseEnter » override will prevent from showing it.

    Marco83
    Participant
    Post count: 6

    Ok! Thanks a lot!

4 sujets de 1 à 4 (sur un total de 4)
  • Vous devez être connecté pour répondre à ce sujet.