public void OnSelectionChanged(PNode oldValue) { PPropertyEventHandler handler = SelectionChanged; if (handler != null) { handler(this, new PPropertyEventArgs(oldValue, selectedNode)); } }
/// <summary> /// Constructs a new PLens. /// </summary> public PLens() { dragBar = PPath.CreateRectangle(0, 0, 100, 100); // Drag bar gets resized to fit the available space, so any rectangle will do here dragBar.Brush = DEFAULT_DRAGBAR_BRUSH; dragBar.Pickable = false; // This forces drag events to percolate up to PLens object AddChild(dragBar); camera = new PCamera(); camera.Brush = DEFAULT_LENS_BRUSH; AddChild(camera); // Create an event handler to drag the lens around. Note that this event // handler consumes events in case another conflicting event handler has been // installed higher up in the heirarchy. lensDragger = new LensDragHandler(); AddInputEventListener(lensDragger); // When this PLens is dragged around adjust the camera's view transform. TransformChanged += new PPropertyEventHandler(PLens_TransformChanged); }