private void ButtonClick(object sender, RoutedEventArgs e) { Log.Info("After pressing Add New Layer button"); var container = ExtractLayerContainer(); var form = new AddLayerWindow(container, false); var result = form.ShowDialog() ?? false; if (!result) { return; } BeginUpdate(); container.AddLayer(form.LayerName, ShapeUtils.FromWpfColor(form.LayerColor)); EndUpdate(); }
private void ListBoxMouseDoubleClick(object sender, MouseButtonEventArgs e) { Log.Info("After pressing 2 click on a layer"); var item = _listBox.SelectedItem; var result = _layers.FirstOrDefault(layer => layer.Item == item); if (result == null) { return; } var contaienr = ExtractLayerContainer(); var form = new AddLayerWindow(contaienr, true); BeginUpdate(); form.UpdateLayerDescription(contaienr, result.Index); var dialogResult = form.ShowDialog() ?? false; if (!dialogResult) { RevertUpdate(); return; } EndUpdate(); }