private void PropertyControl_LayerIndexChanged(string LayerName, int Index) { var selectedStation = selectedNode as Workstation; if (selectedStation == null) { throw new InvalidOperationException(); } Layerstack layers = selectedStation.Layerstack; layers.SetIndex(LayerName, Index); }