// static constructor static GrayscaleEffect() { _pixelShader = new PixelShader(); _pixelShader.UriSource = typeof(GrayscaleEffect).Assembly.ToPackUri("Mpcr.Core.Wpf.Shaders/Bytecode/GrayscaleEffect.ps"); _pixelShader.Freeze(); }