public void AddLayer(Layer layer) { if(layer == null) return; LayerItem layerItem = new LayerItem { IsChecked = layer.IsActive, IsSelected = layer.IsSelected, LayerName = layer.LayerName, BindedCanvas = layer }; layerItem.OnCheckBoxChecked += layer.Activate; layerItem.OnCheckBoxUnchecked += layer.Unactivate; layerItem.Selected += layer.Select; layerItem.Unselected += layer.Unselect; f_layerItems.Insert(0, layerItem); }
public void RemoveLayer(Layer layer) { foreach (LayerItem layerItem in f_layerItems) { if (layerItem.LayerName == layer.LayerName) { f_layerItems.Remove(layerItem); break; } } }