public void AddLayer( int priority, Action<DrawingContext> draw, ChangeType notifyOnChange = ChangeType.Redraw ) { var drawingVisual = new DrawingVisual(); var layerInfo = new WpfLayerInfo( priority, draw, drawingVisual, notifyOnChange ); m_layers.Add( layerInfo ); //Sort the layers by priority m_layers.Sort( ( x, y ) => x.Priority.CompareTo( y.Priority ) ); //Remove all the visual layers and add them in order m_children.Clear(); m_layers.ForEach( l => m_children.Add( l.Visual ) ); }
public void AddLayer(int priority, Action <DrawingContext> draw, ChangeType notifyOnChange = ChangeType.Redraw) { var drawingVisual = new DrawingVisual(); var layerInfo = new WpfLayerInfo(priority, draw, drawingVisual, notifyOnChange); m_layers.Add(layerInfo); //Sort the layers by priority m_layers.Sort((x, y) => x.Priority.CompareTo(y.Priority)); //Remove all the visual layers and add them in order m_children.Clear(); m_layers.ForEach(l => m_children.Add(l.Visual)); }