private string ReadCode(UIElement element) { var target = new RenderTargetBitmap(246, 246, 96, 96, PixelFormats.Pbgra32); target.Render(element); // -- var reader = new BarcodeReader(); var result = reader.Decode(target.AsBitmap()); return(result?.Text); }