Skip to content

Instantly share code, notes, and snippets.

@alandalegend
Created August 10, 2023 22:57
Show Gist options
  • Save alandalegend/96a0874632c1c866e36e885dc7623f13 to your computer and use it in GitHub Desktop.
Save alandalegend/96a0874632c1c866e36e885dc7623f13 to your computer and use it in GitHub Desktop.
XAF para visualizar una imagen subida (como filedata) y se visualice sin necesidad de descargar
private byte[] _VistaImagen;
[NonPersistent]
[ImageEditor(ListViewImageEditorMode = ImageEditorMode.PictureEdit, DetailViewImageEditorMode = ImageEditorMode.PictureEdit, ListViewImageEditorCustomHeight = 40, DetailViewImageEditorFixedHeight = 80)]
[XafDisplayName("Vista (cuando es imagen)")]
public byte[] VistaImagen
{
get
{
if (_VistaImagen == null)
{
try
{
if (Archivo != null)
{
if (Archivo.FileName != "")
{
_VistaImagen = Archivo.Content;
}
}
}
catch { _VistaImagen = null; }
}
return _VistaImagen;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment