private void UpdateEffect(object source) { _multiColorGlyph = source as MultiColorGlyph; if (_multiColorGlyph != null) { Effect = null; return; } _imageSource = TryConvertToImageSource(source); if (_imageSource != null) { if (_imageEffect == null) { _imageEffect = new ImageEffect(); OnImageEffectChanged(); } // Set custom pixel shader. Effect = _imageEffect; } }