Class HostedFrameworkElement
Represents a framework element that keeps track of host objects and provides methods to manage them. This class is useful in scenarios where a framework element can be hosted within a user interface or needs to manage external resources or context-specific objects.
public class HostedFrameworkElement : FrameworkElement, IBaseObjectWithAttr, IBaseObjectWithId, INotifyPropertyChanged, IDisposableObject, IBaseObject, IComponent, IDisposable
- Inheritance
-
HostedFrameworkElement
- Implements
- Derived
Remarks
The HostedFrameworkElement class is designed to manage a collection of host objects, which can include references to native or managed controls. It provides methods to add, remove, retrieve, and dispose of these objects.
<p> The collection of host objects is managed internally and can be accessed
via the <xref href="Alternet.UI.HostedFrameworkElement.HostObjects" data-throw-if-not-resolved="false"></xref> property. Derived classes can override the provided
methods to customize the behavior for managing host objects. </p>
Properties
- HostObjects
Gets list of host objects. For example, it can contain native object references or IContextMenuHost controls such as PopupToolBar or InnerPopupToolBar.
Methods
- AddHostObject(object)
Adds a host object to the collection of context menu hosts if it is not already present.
- DisposeHostObjects()
Releases resources held by the host objects and clears the collection.
- DisposeManaged()
Override to dispose managed resources. Here we dispose all used object references.
- FindHostObjectIndex(Predicate<object>)
Finds the index of the first host object in HostObjects that matches the specified predicate.
- GetHostObject<T>()
Retrieves the first host object of the specified type from the available host object.
- GetHostObjects<T>()
Retrieves all host objects of the specified type from the collection.
- RemoveHostObject(object)
Removes the specified host object from the collection of host objects.