/// <summary> /// Sets the mode and notify all properties. /// </summary> /// <param name="layerageCollection"> The layerage-collection. </param> public void SetMode(LayerageCollection layerageCollection) { //Layerages IEnumerable <Layerage> selectedLayeragesRecursive = LayerageCollection.GetAllSelectedRecursive(layerageCollection); int count = selectedLayeragesRecursive.Count(); if (count == 0) { this.SetModeNone();//None } else if (count == 1) { Layerage outermost = LayerageCollection.FindOutermostLayerage(selectedLayeragesRecursive); this.SetModeSingle(outermost);//Single } else if (count >= 2) { this.SetModeMultiple(selectedLayeragesRecursive);//Multiple } }