public void ClipboardToLayer() { if (!ActiveWindowHelper.MainWindowActive || !IsActive) { return; } try { GeneralHelpers.ExecuteSta(() => { var data = (string)Clipboard.GetData("layer"); if (data == null) { return; } var layerModel = JsonConvert.DeserializeObject <LayerModel>(data); if (layerModel == null) { return; } if (SelectedLayer != null) { SelectedLayer.InsertAfter(layerModel); } else { SelectedProfile.Layers.Add(layerModel); SelectedProfile.FixOrder(); } Execute.OnUIThread(() => UpdateLayerList(layerModel)); }); } catch (Exception) { // ignored } }