private void Loadprofile(Test item) { try { ID = item.Id; txtname.Text = item.Name; txtpath.Text = item.Path; image = item.image; imgPhoto.Source = null; if (item.image != null) { BitmapImage _BitmapImage = new BitmapImage(); _BitmapImage = ImageHelper.BytesToBitmapImage(item.image); imgPhoto.Source = _BitmapImage; } } catch (Exception ex) { MessageDialogHelper.Show(ex.Message, "ERROR"); } }