private void ModifyLayer(Processing.Bitmap.IProcBitmap modify, string windowTitle)
 {
     if (LayerSlider != null &&
         Layers != null &&
         Layers[(int)LayerSlider.Value] != null &&
         Layers[(int)LayerSlider.Value].Bitmap != null)
     {
         var bitmapPreview = new BitmapPreview(modify.Process(Layers[(int)LayerSlider.Value].Bitmap));
         bitmapPreview.ShowReplace = Visibility.Collapsed;
         bitmapPreview.WindowTitle = windowTitle;
         bitmapPreview.Show();
     }
 }
 private void ModifyAllLayersAndSwap(Processing.Bitmap.IProcBitmap modify)
 {
     if (Layers != null)
     {
         foreach (BitmapInfo layer in Layers)
         {
             if (layer != null && layer.Bitmap != null)
             {
                 layer.Bitmap = modify.Process(layer.Bitmap);
             }
         }
         ImageBox.Source = Layers[(int)LayerSlider.Value].Bitmap;
     }
 }