Click or drag to resize

PopupHandler Class

This objects help to determine when a popup has to be closed. This can be by clicking somewhere else, clicking in the title bar or moving the window.
Inheritance Hierarchy
SystemObject
  SniffCore.PopupsPopupHandler

Namespace:  SniffCore.Popups
Assembly:  SniffCore.Popups (in SniffCore.Popups.dll) Version: 1.1.0
Syntax
C#
public class PopupHandler

The PopupHandler type exposes the following members.

Constructors
  NameDescription
Public methodPopupHandler
Initializes a new instance of the PopupHandler class
Top
Methods
  NameDescription
Public methodAutoClose
Starts an observing of the window which contains the control to determine when the item has to be closed.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodIsNullOrEmpty
Checks if the object is null or an empty string.
(Defined by ObjectEx.)
Public Extension MethodIsNullOrWhiteSpace
Checks if the object is null, an empty string or a string which consists of whitespace (or tabs) only.
(Defined by ObjectEx.)
Top
Examples
C#
public class Control : ContentControl
{
    private PopupHandler _popupHandler;

    public override void OnApplyTemplate()
    {
        var popup = GetTemplateChild("PART_Popup") as Popup;
        if (popup == null)
            return;

        _popupHandler = new PopupHandler();
        _popupHandler.AutoClose(popup, OnPopupClosed);
    }

    private void OnPopupClosed()
    {
    }
}
See Also