private void ButtonNewLayer_OnClick(object sender, RoutedEventArgs e) { try { var layerWindow = new StreamDeckLayerWindow(_streamDeckPanel.LayerList, _streamDeckPanel); layerWindow.ShowDialog(); if (layerWindow.DialogResult == true) { _streamDeckPanel.AddLayer(layerWindow.NewLayer); SetFormState(); } } catch (Exception ex) { Common.ShowErrorMessageBox(ex); } }