public CloudAccountVM(Contract_CloudAccount cc) { Icon=Application.Current.Dispatcher.Invoke(() => { if (cc?.Icon == null) return null; MemoryStream ms = new MemoryStream(cc.Icon); ms.Seek(0, SeekOrigin.Begin); BitmapImage icon = new BitmapImage(); icon.BeginInit(); icon.StreamSource = ms; icon.EndInit(); return icon; }); Name = cc.Name; Provider = cc.Provider; CloudID = cc.CloudID; }
public CloudAccountVM(Contract_CloudAccount cc) { Icon = Application.Current.Dispatcher.Invoke(() => { if (cc?.Icon == null) { return(null); } MemoryStream ms = new MemoryStream(cc.Icon); ms.Seek(0, SeekOrigin.Begin); BitmapImage icon = new BitmapImage(); icon.BeginInit(); icon.StreamSource = ms; icon.EndInit(); return(icon); }); Name = cc.Name; Provider = cc.Provider; CloudID = cc.CloudID; }