Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for byte array on Image.Source #217

Merged
merged 1 commit into from
Oct 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Fabulous.Core/ViewConverters.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ open System.Collections.Generic
open System.ComponentModel
open System.Reflection
open System.Diagnostics
open System.IO
open System.Windows.Input
open Xamarin.Forms
open Xamarin.Forms.StyleSheets
Expand Down Expand Up @@ -148,6 +149,7 @@ module Converters =
let makeImageSource (v: obj) =
match v with
| :? string as path -> ImageSource.op_Implicit path
| :? (byte array) as bytes -> ImageSource.FromStream(fun () -> new MemoryStream(bytes) :> Stream)
| :? ImageSource as imageSource -> imageSource
| _ -> failwithf "makeImageSource: invalid argument %O" v

Expand Down