Code Monkey home page Code Monkey logo

xamarin-forms-book-samples's Introduction

xamarin-forms-book-samples

This repo has been archived. The samples are no longer current, or updated. However, they still make a great learning resource.

Sample code for the book Creating Mobile Apps with Xamarin.Forms. The book can be downloaded from https://docs.microsoft.com/xamarin/xamarin-forms/creating-mobile-apps-xamarin-forms/.

A handful of F# samples in this repo are available via the Microsoft code sample browser, but there are over 1,000 projects and the majority of them are only available by cloning the repo.

Notes

Loading the NuGet Packages

The Xamarin.Forms NuGet packages are not part of these projects. They must be downloaded for each project.

To avoid hassles, download the NuGet packages for the solutions in the Libraries directory first. You'll want to load each library solutions into Visual Studio, right-click the solution name in the Solution List and select Manage NuGet Packages for Solution. A notice might appear at the top of the Manage NuGet Packages dialog that says "Some NuGet packages are missing from this solution. Click to restore from you online package sources." If so, click the Restore button and then the Close button. Build the library.

Do the same thing with the other library solutions in the Libraries directory.

You can then load any of the application projects. For each project, again right-click the solution name, select Manage NuGet Packages for Solution and go through the same process.

The Branches

The original-code-from-book branch of this repository contains the code as it appeared in the Creating Mobile Apps with Xamarin.Forms book. The only change is that the projects have been updated to the latest Xamarin.Forms version.

The projects in the master branch reflect changes in C# and Xamarin.Forms since the writing of the book. These changes are:

  • In code files, the deprecated Device.OnPlatform calls have been replaced with logic using the Device.RuntimePlatform property.
  • In XAML files, deprecated properties of the OnPlatform class have been replaced with On objects.
  • The use of the deprecated Device.TargetPlatform property have been replaced with Device.RuntimePlatform.
  • Calls to the deprecated VisualElement.GetSizeRequest method have been replaced with calls to Measure.
  • Overrides of the deprecated VisualElement.OnSizeRequest method have been replaced with overrides of OnMeasure.
  • Calls to and implementations of the deprecated TypeConverter.ConvertFrom method have been replaced with ConvertFromInvariantString.
  • The NamedColor class is now based on the Color structure rather than its own static fields.
  • The Android projects have been upgraded to use AppCompat and Material Design. This is consistent with recent Xamarin.Forms project templates.
  • The blank bitmaps in the Assets folder of the UWP projects have been replaced with Xamagon images.
  • Event firing uses the null-conditional operator (?.) and the Invoke method.

The Projects

These solutions contain three application projects:

  • iOS: iPhone and iPads
  • Droid: Android phones and tablets
  • UWP: The Universal Windows Platform, targeting Windows 10 tablets and desktop computers, and Windows 10 Mobile

The original-code-from-book branch also contains the following two applicatin projects:

  • Windows: Windows 8.1 tablets and desktop computers using the Windows Runtime API
  • WinPhone: Windows Phone 8.1 devices using the Windows Phone API.

You can deploy the UWP project to devices or emulators. However, you must select the correct platform for the deployment target. You generally do this by selecting a platform for the solution in the Solution Platform dropdown on the Standard toolbar. Or, you can invoke the Configuration Manager dialog form the Build | Configuration Manager menu item, and select an item from the Active solution platform dropdown at the top right.

The six possible Solution Platform options are listed below. Each is associated with a particular platform for the UWP project. This platform refers to processor architectures:

  • Any CPU: UWP platform is x86
  • ARM: UWP platform is ARM
  • iPhone: UWP platform is x86
  • iPhone Simulator: UWP platform is x86
  • x86: UWP platform is x86
  • x64: UWP platform is x64

These reflect the only three possibilities for the UWP project. As you can see, x86 (32-bit Intel architecture) is considered to be the default.

Currently, you can deploy the UWP project in several different ways based on a selection in the dropdown on the Standard toolbar.

  • Select Local Machine to deploy directly to the Windows 10 desktop. The UWP platform must be x86 or x64.

  • Select Simulator to deploy to a Windows 10 simulator window. The UWP platform must be x86.

  • Select one of the items beginning with the words Mobile Emulator 10.0 to deploy to a Windows 10 Mobile emulator. The UWP platform must be x86.

  • Select Device to deploy to a Windows 10 Mobile device. The UWP platform must be ARM.

Version upgrades

As of August 12, 2016, all sample code has been upgraded to Xamarin.Forms version 2.3.1.114.

As of November 23, 2016, all sample code has been upgraded to Xamarin.Forms version 2.3.3.168.

As of May 2, 2017, all sample code has been upgraded to Xamarin.Forms version 2.3.4.231.

As of November 3, 2017, all sample code has been upgraded to Xamarin.Forms version 2.4.0.38779.

As of April 13, 2018, all sample code has been upgraded to Xamarin.Forms version 2.5.0.280555.

Removing Obsolete Project Types

As of April 17, 2018, all Windows (Windows 8.1) and WinPhone (Windows Phone 8.1) projects have been removed from the samples. The Windows and WinPhone projects can still be found in the original-code-from-book branch.

.NET Standard

As of May 3, 2018, all solutions in the master branch have been converted from using Portable Class Libraries (PCL) to .NET Standard 2.0 libraries. In addition, the application projects have been converted to a new format using PackageReference. This conversion makes the solutions much closer to what Visual Studio 2017 creates today as a new Xamarin.Forms solution.

The new features of the .csproj files simplify the references to NuGet libraries. There are no longer any packages.config files in any of the projects, and the references to NuGet libraries in the .csproj files are greatly reduced in bulk. The .NET Standard Library project no longer has an AssemblyInfo.cs file, and the UWP project no longer has any project.json or project.lock.json files.

The solutions using PCL's have been archived in the archive-pcl branch. That branch will not be updated.

It is recommended that all new Xamarin.Forms projects be created with Visual Studio 2017, and that Visual Studio 2017 also be used for existing Xamarin.Forms projects.

As of May 4, 2018, all solutions in the master branch have been upgraded to Xamarin.Forms 2.5.1.527436.

As of May 9, 2018, all solutions in the master branch have been upgraded to Xamarin.Forms 3.0.0.446417.

As of July 17, 2018, all solutions in the master branch have been upgraded to Xamarin.Forms 3.1.0.637273.

As of September 4, 2018, all iOS projects in the master branch have been restricted to 64-bit architectures.

As of September 10, 2018, the deprecated AndroidUseLastestPlatformSdk element has been removed from all Android project files in the master branch.

As of September 14, 2018, another PropertyGroup has been added to the .NET Standard library with a DebugType element. This is required for setting breakpoints when deploying to the UWP.

xamarin-forms-book-samples's People

Contributors

conceptdev avatar davidbritch avatar dshontz avatar jamessdixon avatar lobrien avatar mykyta-bondarenko avatar rolfbjarne avatar supernova-eng avatar twinsbaltiya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xamarin-forms-book-samples's Issues

Chapter 1 - "ResolveLibraryProjectImports" on Xamarin.Forms v2.3.3.193

Hi, this is the output message (I will translate it to English, the first message only):

Gravedad	Cรณdigo	Descripciรณn	Proyecto	Archivo	Lรญnea	Estado suprimido
Error		Error inesperado en la tarea "ResolveLibraryProjectImports".
System.IO.PathTooLongException: The specified route or the filename (or both) are too long. Full filename should be less than 260 characters, and pathname should be less than 248.
   en System.IO.PathHelper.GetFullPathName()
   en System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   en System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   en System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
   en System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   en System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   en Xamarin.Tools.Zip.ZipEntry.DoExtract(IntPtr zipFile, String destinationPath, FileMode outputFileMode, EntryExtractEventArgs args)
   en Xamarin.Tools.Zip.ZipEntry.Extract(String destinationDir, String destinationFileName, FileMode outputFileMode)
   en Xamarin.Android.Tools.Files.ExtractAll(ZipArchive zip, String destination, Action`2 progressCallback)
   en Xamarin.Android.Tasks.ResolveLibraryProjectImports.Extract(DirectoryAssemblyResolver res, ICollection`1 jars, ICollection`1 resolvedResourceDirectories, ICollection`1 resolvedAssetDirectories, ICollection`1 resolvedEnvironments)
   en Xamarin.Android.Tasks.ResolveLibraryProjectImports.Execute()
   en Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   en Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()	PlatformVisuals.Droid			

I've located this project in my C:. It makes no sense to me this error (and it's happening in similar projects).

Is there any workaround?

Chapter 13 - WebBitmap is blank

Both the code and XAML versions of WebBitmap produce a blank screen on my Android emulator (VS2015, Hyper-V, 5" KitKat Emulator, Windows10). The same Universal Windows and Windows 8.1 projects do show an image. It is only the Android emulator that has the problem, though I haven't tried iOS or Windows Phone.
The url also shows an image if I navigate to it in a browser. Is this a security issue? Could it be a firewall issue? This is the image: http://developer.xamarin.com/demo/IMG_1415.JPG

The ImageBrowser Android project fails also, probably for the same reason. No images.
Similarly the BitmapStreams project displays the resource stream but not the WebRequest stream.

Same with Chapter 16 WebViewDemo. It works perfectly on UWP or Windows but displays nothing on the Android emulator running in Hyper-V.

This is a Hyper-V emulator IP / router problem. The Android emulator does not have a valid IP address. I'm working with a router technician now... This can be closed.
(The problem was IPS detection. When I turned it off, everything worked)

Transparency

in the class BmpMaker in the method SetPixel i can see an alpha (a) attribute. I know that BMP do not have transparency. why you have it?

Chapter 8 ColorViewList: Unhandled Exception

I'm getting an unhandled exception when trying to deploy the ColorViewList program with the following message:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

It breaks at line 21 of the .g.cs file this.LoadFromXaml(typeof(ColorViewListPage));
I have Xamarin C8 / 4.2.0.680 installed for Visual Studio 2015 which was released only a few days ago and other projects in the chapter deploy ok.

chapter 17 GridBarChart, inconsistency in frame fading when screen orientation changes

when tapping a bar(boxView)in the chart, the event OnBoxViewTapped runs to set overlay(Frame).Opacity = 1. the timer below then fades that frame out. the issue is when screen orientation = Landscape it takes much more time to fade than in Portrait orientation!

Device.StartTimer(TimeSpan.FromMilliseconds(15) , () =>
            {
                overlay.Opacity = Math.Max(0, overlay.Opacity - 0.007);
                if (overlay.Opacity == 0)
                    overlay.IsVisible = false;
                else overlay.IsVisible = true;
                return true;
            });

couldnt find a solution or reason for this inconsistency!

Suggestions for Chapter 29

Thanks for recent "Deep Dive into SkiaSharp with Xamarin.Forms"

One of the challenging issues with CustomRenderer for Xamarin Forms is vector drawing and image manipulation across different platform. E.g. To create custom Frame (with unique gradient background) across android, iOS, and UWP, typically one need to identify how to draw gradient in each platform.

With SkiaSharp, perhaps it is possible to avoid MOST of these customRenderer.

Create e.g FrameSkia that inherit from Frame, create e.g. transparent gradient in the background and add effect to border that normally requires Platform specific drawing.

=> implementing more SkiaSharp custom drawn UI elements could potentially UNLOCK More Creativity when using Xamarin Forms UI <=

FYI similar discussion: Orc.Skia

Suggestion for Chapter 29: Create CustomRenderer using SkiaSharp

"Chapter 13 - Bitmaps" is missing the subject "How to SAVE bitmaps"

Thank you Mr @charlespetzold for the "Chapter 13 Bitmaps" of your book. It is extremely useful and clear. The only issue that I have is that the chapter seems to cover only the half of the subject, specifically "how to LOAD bitmaps", but not the also very importat subject of "how to SAVE bitmaps". Saving images (both locally or sending them to a remote web stream) is a very common process (think about image caching, photo cropping and resizing, svg icons caching... all such activities require to SAVE and LOAD images from a temp folder or a remote stream) but it is not covered in your book. And dealing with stream downloading and caching threads, local folders, PCL External Storage paths and writing permissions issues can be hard. Can we hope to see such argument treated in full in your next revision of the book?

Examples assume external Xamarin - Dont work out of the box with new VS2015 w/Xamarin included

When loading chapter 1's solution the following errors appear in VS2015:

Install Missing Features
Install Xamarin to build native iOS apps in C#.
Develop iOS and Android apps in C# and share the same code with your existing .NET proJects.
Learn more:
http://go.microsoft.com/fwIink/?LinkId:617021
The following proJects will not be loaded unless you install the above feature:
XP IatformVisuaIs.iOS.csproj
Install Xamarin to build native Android apps in C#.
Develop iOS and Android apps in C# and share the same code with your existing .NET proJects.
Learn more:
http://go.microsoft.com/fwIink/?LinkId:617023
The following proJects will not be loaded unless you install the above feature:
. XP IatformVisuaIs.DroidXPIatformVisuaIs.Droid.csproj

Chapter 28 Map demos on Android issues

When trying to run the demos from Chapter 28 on an Android emulator in Visual Studio 17, I get these 2 problems:
WhereAmI.Droid:
public void StartTracking() {
IList locationProviders = locationManager.AllProviders;
foreach (string locationProvider in locationProviders) {
//error occurs here (locationProvider = "passive")
locationManager.RequestLocationUpdates(locationProvider, 1000, 1, this);
}
and
MapDemos.Droid: when I set IsShowingUser to true

PowersOfThree app example missings

increase or decrease a number is look like less than "Hello World",

for example, if I call over bilion of bilion times increase command, what will happened?

Please left simply code; how you handle if command throwed any exception.

Chapter 13: Resource folder vs Asset Catalog

I'm working through the exercises in the book by creating my own Visual Studio solution and either copying/pasting code or linking projects. The Platform-Specific bitmaps code is not working for me for my iPhone, I think because on iOS it is looking for the icons in the Resources folder. And that's where they are in the PlatformSpecificBitmaps solution. But when I create a new Mobile cross platform project, the icons appear to be in an Asset Catalog. I could just copy them into Resources to make the code work, but I am wondering if the project structure has changed. Do you cover how to get icons from asset catalogs in iOS?

Thanks,
assets catalog in ios project

Latest Xamarin Forms 2.2.x

I'm having the hardest time upgrading the project samples to use the latest stable version of Xamarin Forms, 2.2.0.31 at the moment. Specifically the MvvmClock sample from chapter 18, it keeps failing to build citing a dependency on version 2.1.x of Xamarin Forms even though I keep trying to update the whole solution to use version 2.2. I've tried using both Xamarin Studio and Visual Studio 2015, same result. What am I missing?

Chapter 16: BindingPathDemos exception

When I try to run the BindingPathDemos project in Chapter 16, the code throws an AmbiguousMatchException. Visual Studio 2017 v. 15.7.4, Xamarin 4.10.10.2. Those paths are indeed difficult to debug...
chap 16 bindingpathdemos error

Adding new items in PhotoWrap sample in the WrapLayout will reset the scrollviewer

Once we try doing a incremental loading approach and add more items as the user scrolls to the end of the WrapLayout adding new items will reset the position of the ScrollViewer in which the WrapLayout is present. The position is reset back to the top of the WrapLayout.

I have tried caching the position of the ScrollViewer and place it back once the incremental loading is done. But this is not smooth approach.

Charterer 1 Android Build error MSB3231 Unable to remove directory

Charpter1 Andriod build with error

MSB3231: Unable to remove directory "obj\Debug\81\android\bin\classes". Could not find a part of the path 'AccessibilityManagerCompat_AccessibilityStateChangeListenerImplementor.class'.

Have tried to clean and build, clean and rebuild solution and PlatformVisuals.Droid project, manual delete "obj\Debug\81\android\bin\classes" files and restored NuGet package, the problem still persists.

Error The "GenerateResourceDesigner" task failed unexpectedly.

Presently, I am attempting to build this solution using Visual Studio 2015 Version 14.0.25123.00 Update 2 and Windows 10 Version 1511 build 10586.420:

~\xamarin-forms-book-samples-master\Chapter18\MvvmClock\MvvmClock.sln

This is one of the errors I'm getting:

Severity    Code    Description Project File    Line    Suppression State
Error       The "GenerateResourceDesigner" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'MvvmClock, Version=, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'MvvmClock.dll'
   at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(String fullName, ReaderParameters parameters)
   at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(String fullName)
   at Xamarin.Android.Tuner.DirectoryAssemblyResolver.GetAssembly(String fileName)
   at Xamarin.Android.Tasks.GenerateResourceDesigner.<Execute>c__AnonStorey0.<>m__0(String ass)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at Xamarin.Android.Tasks.ResourceDesignerImportGenerator.CreateImportMethods(IEnumerable`1 libraries)
   at Xamarin.Android.Tasks.GenerateResourceDesigner.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() MvvmClock.Droid C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets   1225    

Does anyone have any suggestions? TIA.

UPDATE:

Also getting this error:

Severity    Code    Description Project File    Line    Suppression State
Error       The "GetAdditionalResourcesFromAssemblies" task failed unexpectedly.
System.UnauthorizedAccessException: Access to the path '~\xamarin-forms-book-samples-master\Chapter18\MvvmClock\MvvmClock\MvvmClock.Droid\obj\Debug\resourcepaths.cache' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
   at System.Xml.XmlWriterSettings.CreateWriter(String outputFileName)
   at System.Xml.XmlWriter.Create(String outputFileName, XmlWriterSettings settings)
   at System.Xml.Linq.XDocument.Save(String fileName, SaveOptions options)
   at System.Xml.Linq.XDocument.Save(String fileName)
   at Xamarin.Android.Tasks.GetAdditionalResourcesFromAssemblies.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() MvvmClock.Droid C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets   348 

Picker Binding No Longer Works As Illustrated

On page 540 there is a section on how one could construct a bindable picker by binding to the Picker SelectedIndex property. This is no longer supported, at least with Xamarin templates 1.0.204 and Xamarin version 4.10.10.2. David Britch and Craig Dunn have a sample bindable picker that works differently, using the picker as the source and binding to the label text as a target.

Chapter 23: Missing BoolToObjectConverter

Hi there,

on the page 875 of the book, there is a BoolToObjectConverter used, but for its implementation we have to go to github account (its part of the toolkit). It would be better to include it to the chapter.

Anyway, good job guys I love that book!

Please support Vietnamese Document!

Hi Charles!
Your book is very useful but there are some parts I can not complete understand. Please supporting Vietnamese Document. Thank you!

Incorrect class reference in book.

On page 424, the last paragraph preceding the App class (second last line) talks about an ApplicationPage - this should be a NavigationPage?

Opening projects in VS 2017

Attempting to open projects using VS 2017 Community will result in the following message (this particular batch is for the project Hello in Chapter 2):

Unsupported
This version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them. 
For more information on enabling these project types or otherwise migrating your assets, please see the details in the "Migration Report" displayed after clicking OK.
	 - Hello.Windows, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello.Windows\Hello.Windows.csproj"
	 - Hello.WinPhone, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello.WinPhone\Hello.WinPhone.csproj"


No changes required
These projects can be opened in Visual Studio 2015, Visual Studio 2013, Visual Studio 2012, and Visual Studio 2010 SP1 without changing them.
	 - Hello, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello\Hello.csproj"
	 - Hello.iOS, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello.iOS\Hello.iOS.csproj"
	 - Hello.Droid, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello.Droid\Hello.Droid.csproj"
	 - Hello.UWP, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello\Hello.UWP\Hello.UWP.csproj"
	 - Hello, "C:\Users\Aaron\Documents\Visual Studio 2017\Projects\xamarin-forms-book-samples-master\Chapter02\Hello\Hello.sln"

Most of the projects will display a similar "Unsupported" message. Are there plans to update these example files for VS 2017? What are the minimum steps I can take to get these examples to open in VS 2017? Thank you for your help.

NamedColor class not provided

The NamedColor class referenced in Chapter 19 is not in the code samples, and the code in the print version does not include the static Color definitions. I'm providing it here below if anyone is interested.

using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using Xamarin.Forms;

namespace Xamarin.FormsBook.Toolkit
{
public class NamedColor
{
// Instance members.
private NamedColor()
{
}

    public string Name { private set; get; }

    public string FriendlyName { private set; get; }

    public Color Color { private set; get; }

    public string RgbDisplay { private set; get; }

    // Static members.
    static NamedColor()
    {
        List<NamedColor> all = new List<NamedColor>();
        StringBuilder stringBuilder = new StringBuilder();

        // Loop through the public static fields of the Color structure.
        foreach (FieldInfo fieldInfo in typeof(Color).GetRuntimeFields ())
        {
            if (fieldInfo.IsPublic &&
                fieldInfo.IsStatic &&
                fieldInfo.FieldType == typeof (Color))
            {
                // Convert the name to a friendly name.
                string name = fieldInfo.Name;
                stringBuilder.Clear();
                int index = 0;

                foreach (char ch in name)
                {
                    if (index != 0 && Char.IsUpper(ch))
                    {
                        stringBuilder.Append(' ');
                    }
                    stringBuilder.Append(ch);
                    index++;
                }

                // Instantiate a NamedColor object.
                Color color = (Color)fieldInfo.GetValue(null);

                NamedColor namedColor = new NamedColor
                {
                    Name = name,
                    FriendlyName = stringBuilder.ToString(),
                    Color = color,
                    RgbDisplay = String.Format("{0:X2}-{1:X2}-{2:X2}",
                                               (int)(255 * color.R),
                                               (int)(255 * color.G),
                                               (int)(255 * color.B))
                };

                // Add it to the collection.
                all.Add(namedColor);
            }
        }
        all.TrimExcess();
        All = all;
    }

    public static IList<NamedColor> All { private set; get; }

    public static readonly Color aliceblue = Color.FromRgb(240, 248, 255);
    public static readonly Color antiquewhite = Color.FromRgb(250, 235, 215);
    public static readonly Color aqua = Color.FromRgb(0, 255, 255);
    public static readonly Color aquamarine = Color.FromRgb(127, 255, 212);
    public static readonly Color azure = Color.FromRgb(240, 255, 255);
    public static readonly Color beige = Color.FromRgb(245, 245, 220);
    public static readonly Color bisque = Color.FromRgb(255, 228, 196);
    public static readonly Color black = Color.FromRgb(0, 0, 0);
    public static readonly Color blanchedalmond = Color.FromRgb(255, 235, 205);
    public static readonly Color blue = Color.FromRgb(0, 0, 255);
    public static readonly Color blueviolet = Color.FromRgb(138, 43, 226);
    public static readonly Color brown = Color.FromRgb(165, 42, 42);
    public static readonly Color burlywood = Color.FromRgb(222, 184, 135);
    public static readonly Color cadetblue = Color.FromRgb(95, 158, 160);
    public static readonly Color chartreuse = Color.FromRgb(127, 255, 0);
    public static readonly Color chocolate = Color.FromRgb(210, 105, 30);
    public static readonly Color coral = Color.FromRgb(255, 127, 80);
    public static readonly Color cornflowerblue = Color.FromRgb(100, 149, 237);
    public static readonly Color cornsilk = Color.FromRgb(255, 248, 220);
    public static readonly Color crimson = Color.FromRgb(220, 20, 60);
    public static readonly Color cyan = Color.FromRgb(0, 255, 255);
    public static readonly Color darkblue = Color.FromRgb(0, 0, 139);
    public static readonly Color darkcyan = Color.FromRgb(0, 139, 139);
    public static readonly Color darkgoldenrod = Color.FromRgb(184, 134, 11);
    public static readonly Color darkgray = Color.FromRgb(169, 169, 169);
    public static readonly Color darkgreen = Color.FromRgb(0, 100, 0);
    public static readonly Color darkkhaki = Color.FromRgb(189, 183, 107);
    public static readonly Color darkmagenta = Color.FromRgb(139, 0, 139);
    public static readonly Color darkolivegreen = Color.FromRgb(85, 107, 47);
    public static readonly Color darkorange = Color.FromRgb(255, 140, 0);
    public static readonly Color darkorchid = Color.FromRgb(153, 50, 204);
    public static readonly Color darkred = Color.FromRgb(139, 0, 0);
    public static readonly Color darksalmon = Color.FromRgb(233, 150, 122);
    public static readonly Color darkseagreen = Color.FromRgb(143, 188, 139);
    public static readonly Color darkslateblue = Color.FromRgb(72, 61, 139);
    public static readonly Color darkslategray = Color.FromRgb(47, 79, 79);
    public static readonly Color darkturquoise = Color.FromRgb(0, 206, 209);
    public static readonly Color darkviolet = Color.FromRgb(148, 0, 211);
    public static readonly Color deeppink = Color.FromRgb(255, 20, 147);
    public static readonly Color deepskyblue = Color.FromRgb(0, 191, 255);
    public static readonly Color dimgray = Color.FromRgb(105, 105, 105);
    public static readonly Color dodgerblue = Color.FromRgb(30, 144, 255);
    public static readonly Color firebrick = Color.FromRgb(178, 34, 34);
    public static readonly Color floralwhite = Color.FromRgb(255, 250, 240);
    public static readonly Color forestgreen = Color.FromRgb(34, 139, 34);
    public static readonly Color fuchsia = Color.FromRgb(255, 0, 255);
    public static readonly Color gainsboro = Color.FromRgb(220, 220, 220);
    public static readonly Color ghostwhite = Color.FromRgb(248, 248, 255);
    public static readonly Color gold = Color.FromRgb(255, 215, 0);
    public static readonly Color goldenrod = Color.FromRgb(218, 165, 32);
    public static readonly Color gray = Color.FromRgb(128, 128, 128);
    public static readonly Color green = Color.FromRgb(0, 128, 0);
    public static readonly Color greenyellow = Color.FromRgb(173, 255, 47);
    public static readonly Color honeydew = Color.FromRgb(240, 255, 240);
    public static readonly Color hotpink = Color.FromRgb(255, 105, 180);
    public static readonly Color indianred = Color.FromRgb(205, 92, 92);
    public static readonly Color indigo = Color.FromRgb(75, 0, 130);
    public static readonly Color ivory = Color.FromRgb(255, 255, 240);
    public static readonly Color khaki = Color.FromRgb(240, 230, 140);
    public static readonly Color lavender = Color.FromRgb(230, 230, 250);
    public static readonly Color lavenderblush = Color.FromRgb(255, 240, 245);
    public static readonly Color lawngreen = Color.FromRgb(124, 252, 0);
    public static readonly Color lemonchiffon = Color.FromRgb(255, 250, 205);
    public static readonly Color lightblue = Color.FromRgb(173, 216, 230);
    public static readonly Color lightcoral = Color.FromRgb(240, 128, 128);
    public static readonly Color lightcyan = Color.FromRgb(224, 255, 255);
    public static readonly Color lightgoldenrodyellow = Color.FromRgb(250, 250, 210);
    public static readonly Color lightgray = Color.FromRgb(211, 211, 211);
    public static readonly Color lightgreen = Color.FromRgb(144, 238, 144);
    public static readonly Color lightpink = Color.FromRgb(255, 182, 193);
    public static readonly Color lightsalmon = Color.FromRgb(255, 160, 122);
    public static readonly Color lightseagreen = Color.FromRgb(32, 178, 170);
    public static readonly Color lightskyblue = Color.FromRgb(135, 206, 250);
    public static readonly Color lightslategray = Color.FromRgb(119, 136, 153);
    public static readonly Color lightsteelblue = Color.FromRgb(176, 196, 222);
    public static readonly Color lightyellow = Color.FromRgb(255, 255, 224);
    public static readonly Color lime = Color.FromRgb(0, 255, 0);
    public static readonly Color limegreen = Color.FromRgb(50, 205, 50);
    public static readonly Color linen = Color.FromRgb(250, 240, 230);
    public static readonly Color magenta = Color.FromRgb(255, 0, 255);
    public static readonly Color maroon = Color.FromRgb(128, 0, 0);
    public static readonly Color mediumaquamarine = Color.FromRgb(102, 205, 170);
    public static readonly Color mediumblue = Color.FromRgb(0, 0, 205);
    public static readonly Color mediumorchid = Color.FromRgb(186, 85, 211);
    public static readonly Color mediumpurple = Color.FromRgb(147, 112, 219);
    public static readonly Color mediumseagreen = Color.FromRgb(60, 179, 113);
    public static readonly Color mediumslateblue = Color.FromRgb(123, 104, 238);
    public static readonly Color mediumspringgreen = Color.FromRgb(0, 250, 154);
    public static readonly Color mediumturquoise = Color.FromRgb(72, 209, 204);
    public static readonly Color mediumvioletred = Color.FromRgb(199, 21, 133);
    public static readonly Color midnightblue = Color.FromRgb(25, 25, 112);
    public static readonly Color mintcream = Color.FromRgb(245, 255, 250);
    public static readonly Color mistyrose = Color.FromRgb(255, 228, 225);
    public static readonly Color moccasin = Color.FromRgb(255, 228, 181);
    public static readonly Color navajowhite = Color.FromRgb(255, 222, 173);
    public static readonly Color navy = Color.FromRgb(0, 0, 128);
    public static readonly Color oldlace = Color.FromRgb(253, 245, 230);
    public static readonly Color olive = Color.FromRgb(128, 128, 0);
    public static readonly Color olivedrab = Color.FromRgb(107, 142, 35);
    public static readonly Color orange = Color.FromRgb(255, 165, 0);
    public static readonly Color orangered = Color.FromRgb(255, 69, 0);
    public static readonly Color orchid = Color.FromRgb(218, 112, 214);
    public static readonly Color palegoldenrod = Color.FromRgb(238, 232, 170);
    public static readonly Color palegreen = Color.FromRgb(152, 251, 152);
    public static readonly Color paleturquoise = Color.FromRgb(175, 238, 238);
    public static readonly Color palevioletred = Color.FromRgb(219, 112, 147);
    public static readonly Color papayawhip = Color.FromRgb(255, 239, 213);
    public static readonly Color peachpuff = Color.FromRgb(255, 218, 185);
    public static readonly Color peru = Color.FromRgb(205, 133, 63);
    public static readonly Color pink = Color.FromRgb(255, 192, 203);
    public static readonly Color plum = Color.FromRgb(221, 160, 221);
    public static readonly Color powderblue = Color.FromRgb(176, 224, 230);
    public static readonly Color purple = Color.FromRgb(128, 0, 128);
    public static readonly Color red = Color.FromRgb(255, 0, 0);
    public static readonly Color rosybrown = Color.FromRgb(188, 143, 143);
    public static readonly Color royalblue = Color.FromRgb(65, 105, 225);
    public static readonly Color saddlebrown = Color.FromRgb(139, 69, 19);
    public static readonly Color salmon = Color.FromRgb(250, 128, 114);
    public static readonly Color sandybrown = Color.FromRgb(244, 164, 96);
    public static readonly Color seagreen = Color.FromRgb(46, 139, 87);
    public static readonly Color seashell = Color.FromRgb(255, 245, 238);
    public static readonly Color sienna = Color.FromRgb(160, 82, 45);
    public static readonly Color silver = Color.FromRgb(192, 192, 192);
    public static readonly Color skyblue = Color.FromRgb(135, 206, 235);
    public static readonly Color slateblue = Color.FromRgb(106, 90, 205);
    public static readonly Color slategray = Color.FromRgb(112, 128, 144);
    public static readonly Color snow = Color.FromRgb(255, 250, 250);
    public static readonly Color springgreen = Color.FromRgb(0, 255, 127);
    public static readonly Color steelblue = Color.FromRgb(70, 130, 180);
    public static readonly Color tan = Color.FromRgb(210, 180, 140);
    public static readonly Color teal = Color.FromRgb(0, 128, 128);
    public static readonly Color thistle = Color.FromRgb(216, 191, 216);
    public static readonly Color tomato = Color.FromRgb(255, 99, 71);
    public static readonly Color turquoise = Color.FromRgb(64, 224, 208);
    public static readonly Color violet = Color.FromRgb(238, 130, 238);
    public static readonly Color wheat = Color.FromRgb(245, 222, 179);
    public static readonly Color white = Color.FromRgb(255, 255, 255);
    public static readonly Color whitesmoke = Color.FromRgb(245, 245, 245);
    public static readonly Color yellow = Color.FromRgb(255, 255, 0);
    public static readonly Color yellowgreen = Color.FromRgb(154, 205, 50);



}

}

Chapter 20: Oversight in MandelbrotXFPage.xaml.cs

In the file Chapter20/MandelbrotXF/MandelbrotXF/MandelbrotXF/MandelbrotXFPage.xaml.cs there is a tiny oversight (although it has no impact). On line 171 in SetCrossHairs() it should be setting imagCrossHair as this boxView should be parallel to the imaginary axis (origin at Center-Top of crosshair). Likewise on line 174 realCrossHair should be set.

Method UNDEFINED

The book, at page 578, use method CreateHttp of WebRequest object to instantiate HttpWebRequest request but CreateHttp doesn't exist in this class :/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.