public SessionData()
        {
            NewPrimitives     = new ObservableCollection <NewPrimitive>();
            SnappedPrimitives = new ObservableCollection <SnappedPrimitive>();
            Annotations       = new ObservableCollection <Annotation>();
            sketchObjects     = new PointsSequence[0];
            FeatureCurves     = new ObservableCollection <FeatureCurve>();

            newPrimitivesSelectionListener = new SelectionListener <NewPrimitive>(NewPrimitives, p => p.IsSelected);
            sketchObjectsSelectionListener = new SelectionListener <PointsSequence>(sketchObjects, o => o.IsSelected);
            featureCurvesSelectionListener = new SelectionListener <FeatureCurve>(FeatureCurves, c => c.IsSelected);

            allPrimitives =
                NewPrimitives
                .Select(x => (SelectablePrimitive)x)
                .Concat(SnappedPrimitives.Select(x => (SelectablePrimitive)x));
            allPrimitivesSelectionListener = new SelectionListener <SelectablePrimitive>(allPrimitives, p => p.IsSelected);

            SelectedNewPrimitives = newPrimitivesSelectionListener.SelectedItems;
            SelectedSketchObjects = sketchObjectsSelectionListener.SelectedItems;
            SelectedFeatureCurves = featureCurvesSelectionListener.SelectedItems;
            SelectedPrimitives    = allPrimitivesSelectionListener.SelectedItems;

            PreprocessingData = new Dictionary <string, object>();
        }
 /// <summary>
 /// Enables selection mode.
 /// </summary>
 /// <param name="selectionListener"> listener for selected items count. To get selected messages use <seealso cref="#getSelectedMessages()"/>. </param>
 public virtual void enableSelectionMode(SelectionListener selectionListener)
 {
     if (selectionListener == null)
     {
         throw new System.ArgumentException("SelectionListener must not be null. Use `disableSelectionMode()` if you want tp disable selection mode");
     }
     else
     {
         this.selectionListener = selectionListener;
     }
 }
 /// <summary>
 /// Disables selection mode and removes <seealso cref="SelectionListener"/>.
 /// </summary>
 public virtual void disableSelectionMode()
 {
     this.selectionListener = null;
     unselectAllItems();
 }