Skip to Main Content
Xamarin.Forms Projects
book

Xamarin.Forms Projects

by Johan Karlsson, Daniel Hindrikes
December 2018
Intermediate to advanced content levelIntermediate to advanced
416 pages
10h 30m
English
Packt Publishing
Content preview from Xamarin.Forms Projects

Building the view

Because we want to show the input photo in the input view, we need to convert it from byte[] to Xamarin.Forms.ImageSource. We will do this in a value converter that we can use together with the binding in the XAML by going through the following steps:

  1. Create a new folder called Converters in the HotDogOrNot project.
  2. Create a new class called BytesToImageConverter.
  3. Add and implement the IValueConverter interface, as shown in the following code:
using System;using System.Globalization;using System.IO;using Xamarin.Forms;  public class BytesToImageConverter : IValueConverter{     public object Convert(object value, Type targetType, object     parameter, CultureInfo culture)    {        throw new NotImplementedException();    }    public object ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Xamarin.Forms Projects - Second Edition

Xamarin.Forms Projects - Second Edition

Daniel Hindrikes, Johan Karlsson
Xamarin Blueprints

Xamarin Blueprints

Michael Williams
Xamarin.Forms Solutions

Xamarin.Forms Solutions

Gerald Versluis, Steven Thewissen

Publisher Resources

ISBN: 9781789537505Supplemental Content