Search Results for

    Show / Hide Table of Contents

    Class ObservableMemoryLayer<T>

    Represents a memory-based layer that exposes its data as an observable collection and synchronizes feature changes with the underlying feature set.

    Inheritance
    object
    BaseLayer
    MemoryLayer
    ObservableMemoryLayer<T>
    Implements
    ILayer
    IAnimatable
    INotifyPropertyChanged
    IDisposable
    Inherited Members
    MemoryLayer.Features
    MemoryLayer.FeaturesWereModified()
    MemoryLayer.GetFeatures(MRect, double)
    MemoryLayer.SortFeatures
    MemoryLayer.Extent
    BaseLayer.NextId()
    BaseLayer.PropertyChanged
    BaseLayer.DataChanged
    BaseLayer.Id
    BaseLayer.Tag
    BaseLayer.MinVisible
    BaseLayer.MaxVisible
    BaseLayer.Enabled
    BaseLayer.Name
    BaseLayer.Opacity
    BaseLayer.Busy
    BaseLayer.Style
    BaseLayer.Attribution
    BaseLayer.Resolutions
    BaseLayer.CustomLayerRendererName
    BaseLayer.DataHasChanged()
    BaseLayer.ToString()
    BaseLayer.OnPropertyChanged(string)
    BaseLayer.OnDataChanged(DataChangedEventArgs)
    BaseLayer.Dispose(bool)
    BaseLayer.Dispose()
    BaseLayer.UpdateAnimations()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Mapsui.Layers
    Assembly: Mapsui.dll
    Syntax
    public class ObservableMemoryLayer<T> : MemoryLayer, ILayer, IAnimatable, INotifyPropertyChanged, IDisposable where T : class
    Type Parameters
    Name Description
    T

    The type of items contained in the observable collection. Must be a reference type.

    Remarks

    This class enables two-way synchronization between an ObservableCollection of items and the set of features exposed by the layer. Changes to the collection are automatically reflected in the feature set, and vice versa. This is useful for scenarios where UI or other components need to observe and react to changes in the layer's data in real time.

    Constructors

    | Edit this page View Source

    ObservableMemoryLayer(Func<T, IFeature?>, string?)

    Initializes a new instance of the ObservableMemoryLayer class with the specified feature selector and optional name.

    Declaration
    public ObservableMemoryLayer(Func<T, IFeature?> itemToFeature, string? name = null)
    Parameters
    Type Name Description
    Func<T, IFeature> itemToFeature

    A function gets the IFeature instance related to the item of type T. This function is used to map items in the layer to their corresponding features. Cannot be null.

    string name

    The optional name to assign to the layer. If null, a default name based on the type is used.

    Properties

    | Edit this page View Source

    ObservableCollection

    Gets or sets the underlying collection of items to observe for changes.

    Declaration
    public ObservableCollection<T>? ObservableCollection { get; set; }
    Property Value
    Type Description
    ObservableCollection<T>
    Remarks

    Assigning a new collection will update the internal state to reflect the contents of the provided collection and subscribe to its change notifications. If the collection is replaced, any previous event subscriptions are removed. Setting this property to null will clear the internal state and unsubscribe from change notifications.

    Implements

    ILayer
    IAnimatable
    INotifyPropertyChanged
    IDisposable

    Extension Methods

    LayerExtensions.WaitForLoadingAsync(ILayer)
    DisposableExtension.DisposeIfDisposable(object?)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX